Exemplo n.º 1
0
        public void Read_collection_of_interfaces()
        {
            if (!isPrepopulated)
            {
                return;
            }

            IInterfaceArrays config = new ConfigurationBuilder <IInterfaceArrays>()
                                      .UseConfigStore(store)
                                      .Build();

            IEnumerable <IArrayElement> r = config.Creds;

            List <IArrayElement> rl = r.ToList();

            Assert.Equal(2, rl.Count);

            IArrayElement el0 = rl[0];
            IArrayElement el1 = rl[1];

            Assert.Equal("user1", el0.Username);
            Assert.Equal("pass1", el0.Password);
            Assert.Equal("user2", el1.Username);
            Assert.Equal("pass2", el1.Password);
        }
Exemplo n.º 2
0
        public void Read_collection_of_interfaces()
        {
            IInterfaceArrays config = new ConfigurationBuilder <IInterfaceArrays>()
                                      .UseJsonFile(_path)
                                      .Build();


            IEnumerable <IArrayElement> r = config.Creds;

            List <IArrayElement> rl = r.ToList();

            Assert.Equal(2, rl.Count);

            IArrayElement el0 = rl[0];
            IArrayElement el1 = rl[1];

            Assert.Equal("user1", el0.Username);
            Assert.Equal("pass1", el0.Password);
            Assert.Equal("user2", el1.Username);
            Assert.Equal("pass2", el1.Password);
        }