예제 #1
0
        public void GetAllPersons_ShouldReturnNull()
        {
            var controller = new PersonsController(new PersonComponentFake(new List<PersonDto>()));

            var ps = controller.GetAllPersons();

            Assert.AreEqual(0, ps.Count());
        }
예제 #2
0
        public void GetPerson_ShouldReturnCorrectPerson()
        {
            var controller = new PersonsController(new PersonComponentFake(GetTestPersons()));

            var p = controller.GetPerson(1) as OkNegotiatedContentResult<PersonDto>;

            if (p != null) Assert.AreEqual(GetTestPersons()[1].Firstname, p.Content.Firstname);
        }
예제 #3
0
        public void GetAllPersons_ShouldReturnAllProducts()
        {
            var controller = new PersonsController(new PersonComponentFake(GetTestPersons()));

            var ps = controller.GetAllPersons();

            Assert.AreEqual(GetTestPersons().Count, ps.Count());
        }