public void CreateNameFailedCleanupTest() { var builder = new ClientFactory(); var invalidChars = System.IO.Path.GetInvalidFileNameChars(); Assert.Throws<ArgumentException>(() => builder.Create(new ClientSettings(ClientType.Legacy) { Name = " " + invalidChars[0] + invalidChars[1] + " ", Path = @"\\test\path\" })); }
public void CreateTest() { var legacyClientFactory = MockRepository.GenerateStub<ILegacyClientFactory>(); legacyClientFactory.Stub(x => x.Create()).Return(new LegacyClient()); var builder = new ClientFactory { LegacyClientFactory = legacyClientFactory }; var settings = new ClientSettings(ClientType.Legacy) { Name = "Client{ 1", Path = @"\\test\path\" }; var instance = builder.Create(settings); Assert.IsNotNull(instance); Assert.AreEqual("Client 1", instance.Settings.Name); }
public void CreateArgumentNullTest() { var builder = new ClientFactory(); Assert.Throws<ArgumentNullException>(() => builder.Create(null)); }
public void CreatePathEmptyTest() { var builder = new ClientFactory(); Assert.Throws<ArgumentException>(() => builder.Create(new ClientSettings(ClientType.Legacy) { Name = "Client 1" })); }
public void Create_FahClientFactoryNull_Test() { var builder = new ClientFactory(); var settings = new ClientSettings(ClientType.FahClient) { Name = "FahClient", Server = "192.168.100.200" }; var instance = builder.Create(settings); Assert.IsNull(instance); }
public void Create_LegacyClientFactoryNull_Test() { var builder = new ClientFactory(); var settings = new ClientSettings(ClientType.Legacy) { Name = "LegacyClient", Path = @"\\test\path\" }; var instance = builder.Create(settings); Assert.IsNull(instance); }
public void CreateNameEmptyTest() { var builder = new ClientFactory(); builder.Create(new ClientSettings(ClientType.Legacy)); }
public void CreateArgumentNullTest() { var builder = new ClientFactory(); builder.Create(null); }
public void CreateTest() { var builder = new ClientFactory(); var settings = new ClientSettings(ClientType.Legacy) { Name = "Client{ 1", Path = @"\\test\path\" }; var instance = builder.Create(settings); Assert.IsNotNull(instance); Assert.AreEqual("Client 1", instance.Settings.Name); }
public void CreatePathEmptyTest() { var builder = new ClientFactory(); builder.Create(new ClientSettings(ClientType.Legacy) { Name = "Client 1" }); }
public void Setup() { Client = ClientFactory.Create(); }