public OwnerPetControllerTest() { InitMocks(); var ownerPetValidator = new OwnerPetValidator(new CpfValidator()); var ownerPetDomain = new OwnerPetDomain(ownerPetValidator, _mockOwnerPetRepository); _ownerPetController = new OwnerPetController(ownerPetDomain); }
public void NotFoundScenarioWithPussyCat() { var oOwnerPet = new OwnerPetController().Index("Cat") as ViewResult; if (oOwnerPet != null) { var result = ((Dictionary <string, List <PetBO> >)oOwnerPet.Model); Assert.IsTrue((result.Where(x => x.Key == "Male").FirstOrDefault()).Value.Count == 0); Assert.IsTrue((result.Where(x => x.Key == "Female").FirstOrDefault()).Value.Count == 0); } else { Assert.IsTrue((((ContentResult)(new OwnerPetController().Index("Cat"))).Content).Equals("NotFound", StringComparison.InvariantCultureIgnoreCase)); } }