public void TryGetAll()
        {
            var mock = new Mock <IPeopleDao>();

            mock.Setup(item => item.GetAll()).Returns(new List <Person>()
            {
                new Person
                {
                    Name          = "Eldar",
                    Surname       = "Petrov",
                    DateOfBirth   = new DateTime(1993, 12, 27),
                    Age           = 25,
                    City          = "Omsk",
                    Street        = "50 years of October",
                    NumberOfHouse = "51b"
                }
            });
            var logic = new PeopleLogic(mock.Object);
            var list  = logic.GetAll().ToList();

            Assert.AreEqual(list.Count, 1);
        }
Exemplo n.º 2
0
        public void TryGetAll()
        {
            var mock = new Mock <IPersonDao>();

            mock.Setup(item => item.GetAll()).Returns(new List <Person>()
            {
                new Person
                {
                    Name          = "Alex",
                    Surname       = "Pak",
                    DateOfBirth   = new DateTime(1997, 11, 05),
                    Age           = 21,
                    City          = "Saratov",
                    Street        = "Chapaeva",
                    NumberOfHouse = "60"
                }
            });

            var logic = new PeopleLogic(mock.Object);
            var list  = logic.GetAll().ToList();

            Assert.AreEqual(list.Count, 1, "...");
        }