58 lines
2.1 KiB
C#
58 lines
2.1 KiB
C#
using System;
|
|
using System.IO;
|
|
using Endpoint;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using System.Collections.Generic;
|
|
|
|
namespace EndpointTest
|
|
{
|
|
///// <summary>
|
|
/////This is a test class for ServiceEndpointConfigurationTest and is intended
|
|
/////to contain all ServiceEndpointConfigurationTest Unit Tests
|
|
/////</summary>
|
|
//[TestClass()]
|
|
//public class ServiceEndpointConfigurationTest
|
|
//{
|
|
// private readonly Uri _uri = new Uri("http://www.google.com");
|
|
// private const string _testFilename = "testFilename.xml";
|
|
|
|
// /// <summary>
|
|
// ///A test for SaveConfigurationList
|
|
// ///</summary>
|
|
// [TestMethod]
|
|
// public void SaveAndLoadConfigurationListTest()
|
|
// {
|
|
// try
|
|
// {
|
|
// HttpEndpointConfiguration httpEndpoint = new HttpEndpointConfiguration("", _uri);
|
|
// OracleEndpointConfiguration oracleEndpoint = new OracleEndpointConfiguration("", "connection", "query", "result");
|
|
|
|
// List<IServiceEndpointConfiguration> serviceEndpointConfigurations
|
|
// = new List<IServiceEndpointConfiguration> { httpEndpoint, oracleEndpoint };
|
|
|
|
// IServiceEndpointConfiguration.SaveConfigurationList(serviceEndpointConfigurations, _testFilename);
|
|
|
|
// // load the results
|
|
// List<IServiceEndpointConfiguration> loadedList = IServiceEndpointConfiguration.LoadConfigurationList(_testFilename);
|
|
|
|
// // verify that they're the same
|
|
// foreach (IServiceEndpointConfiguration serviceEndpointConfiguration in serviceEndpointConfigurations)
|
|
// {
|
|
// IServiceEndpointConfiguration tmp = serviceEndpointConfiguration;
|
|
|
|
// IServiceEndpointConfiguration foundConfig
|
|
// = loadedList.Find(loadedEndpointConfig => loadedEndpointConfig.Equals(tmp));
|
|
// Assert.IsNotNull(foundConfig);
|
|
// }
|
|
// }
|
|
// finally
|
|
// {
|
|
// FileInfo f = new FileInfo(_testFilename);
|
|
// // f.CopyTo(@"c:\test.xml");
|
|
// if (f.Exists)
|
|
// f.Delete();
|
|
// }
|
|
// }
|
|
//}
|
|
}
|