public void GetAllPersons_ShouldReturnNull() { var controller = new PersonsController(new PersonComponentFake(new List<PersonDto>())); var ps = controller.GetAllPersons(); Assert.AreEqual(0, ps.Count()); }
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); }
public void GetAllPersons_ShouldReturnAllProducts() { var controller = new PersonsController(new PersonComponentFake(GetTestPersons())); var ps = controller.GetAllPersons(); Assert.AreEqual(GetTestPersons().Count, ps.Count()); }