예제 #1
0
        public OwnerPetControllerTest()
        {
            InitMocks();

            var ownerPetValidator = new OwnerPetValidator(new CpfValidator());
            var ownerPetDomain    = new OwnerPetDomain(ownerPetValidator, _mockOwnerPetRepository);

            _ownerPetController = new OwnerPetController(ownerPetDomain);
        }
예제 #2
0
        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));
            }
        }