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