Exemplo n.º 1
0
        public void CreateCollectionTest()
        {
            var legacyClientFactory = MockRepository.GenerateStub <ILegacyClientFactory>();

            legacyClientFactory.Stub(x => x.Create()).Return(new LegacyClient());
            var builder = new ClientFactory {
                LegacyClientFactory = legacyClientFactory
            };
            var result1 = new ClientSettings(ClientType.Legacy)
            {
                LegacyClientSubType = LegacyClientSubType.Path,
                Name = "Client 1",
                Path = @"\\test\path1\"
            };
            var result2 = new ClientSettings(ClientType.Legacy)
            {
                LegacyClientSubType = LegacyClientSubType.Http,
                Name = "Client 2",
                Path = @"\\test\path2\"
            };
            var result3 = new ClientSettings(ClientType.Legacy)
            {
                LegacyClientSubType = LegacyClientSubType.Ftp
            };
            var instances = builder.CreateCollection(new[] { result1, result2, result3 });

            Assert.AreEqual(2, instances.Count());
        }
Exemplo n.º 2
0
 public void CreateCollectionTest()
 {
     var builder = new ClientFactory();
      var result1 = new ClientSettings(ClientType.Legacy)
                {
                   LegacyClientSubType = LegacyClientSubType.Path,
                   Name = "Client 1",
                   Path = @"\\test\path1\"
                };
      var result2 = new ClientSettings(ClientType.Legacy)
                {
                   LegacyClientSubType = LegacyClientSubType.Http,
                   Name = "Client 2",
                   Path = @"\\test\path2\"
                };
      var result3 = new ClientSettings(ClientType.Legacy)
                {
                   LegacyClientSubType = LegacyClientSubType.Ftp
                };
      var instances = builder.CreateCollection(new[] { result1, result2, result3 });
      Assert.AreEqual(2, instances.Count());
 }
Exemplo n.º 3
0
 public void CreateCollectionTest()
 {
    var legacyClientFactory = MockRepository.GenerateStub<ILegacyClientFactory>();
    legacyClientFactory.Stub(x => x.Create()).Return(new LegacyClient());
    var builder = new ClientFactory { LegacyClientFactory = legacyClientFactory };
    var result1 = new ClientSettings(ClientType.Legacy)
                  {
                     LegacyClientSubType = LegacyClientSubType.Path,
                     Name = "Client 1",
                     Path = @"\\test\path1\"
                  };
    var result2 = new ClientSettings(ClientType.Legacy)
                  {
                     LegacyClientSubType = LegacyClientSubType.Http,
                     Name = "Client 2",
                     Path = @"\\test\path2\"
                  };
    var result3 = new ClientSettings(ClientType.Legacy)
                  {
                     LegacyClientSubType = LegacyClientSubType.Ftp
                  };
    var instances = builder.CreateCollection(new[] { result1, result2, result3 });
    Assert.AreEqual(2, instances.Count());
 }
Exemplo n.º 4
0
 public void CreateCollectionArgumentNullTest()
 {
    var builder = new ClientFactory();
    Assert.Throws<ArgumentNullException>(() => builder.CreateCollection((null)));
 }
Exemplo n.º 5
0
 public void CreateCollectionArgumentNullTest()
 {
     var builder = new ClientFactory();
      builder.CreateCollection((null));
 }
Exemplo n.º 6
0
        public void CreateCollectionArgumentNullTest()
        {
            var builder = new ClientFactory();

            Assert.Throws <ArgumentNullException>(() => builder.CreateCollection((null)));
        }