Example #1
0
 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\"
                                                          }));
 }
Example #2
0
 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);
 }
Example #3
0
 public void CreateArgumentNullTest()
 {
    var builder = new ClientFactory();
    Assert.Throws<ArgumentNullException>(() => builder.Create(null));
 }
Example #4
0
 public void CreatePathEmptyTest()
 {
    var builder = new ClientFactory();
    Assert.Throws<ArgumentException>(() => builder.Create(new ClientSettings(ClientType.Legacy) { Name = "Client 1" }));
 }
Example #5
0
 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);
 }
Example #6
0
 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);
 }
Example #7
0
 public void CreateNameEmptyTest()
 {
     var builder = new ClientFactory();
      builder.Create(new ClientSettings(ClientType.Legacy));
 }
Example #8
0
 public void CreateArgumentNullTest()
 {
     var builder = new ClientFactory();
      builder.Create(null);
 }
Example #9
0
 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);
 }
Example #10
0
 public void CreatePathEmptyTest()
 {
     var builder = new ClientFactory();
      builder.Create(new ClientSettings(ClientType.Legacy)
                 {
                    Name = "Client 1"
                 });
 }
Example #11
0
 public void Setup()
 {
     Client = ClientFactory.Create();
 }