Esempio n. 1
0
        public void Mock_GetViewResultIndex_Test()
        {
            DbSetup();
            VeterinarianController controller = new VeterinarianController(mock.Object);

            var result = controller.Index();

            Assert.IsInstanceOfType(result, typeof(ActionResult));
        }
Esempio n. 2
0
        public void DB_CreateNewEntry_Test()
        {
            VeterinarianController controller = new VeterinarianController(db);
            Veterinarian           testVet    = new Veterinarian();

            testVet.Name = "Steve";

            controller.Create(testVet);
            var collection = (controller.Index() as ViewResult).ViewData.Model as List <Veterinarian>;

            CollectionAssert.Contains(collection, testVet);
        }
Esempio n. 3
0
        public void Mock_ConfirmEntry_Test()
        {
            DbSetup();
            VeterinarianController vetController = new VeterinarianController(mock.Object);
            Veterinarian           testVet       = new Veterinarian();

            testVet.Name      = "Jane";
            testVet.Specialty = "Whatever!";

            ViewResult indexView  = vetController.Index() as ViewResult;
            var        collection = indexView.ViewData.Model as List <Veterinarian>;

            CollectionAssert.Contains(collection, testVet);
        }