Пример #1
0
        public void GetAll_VetsEmptyAtFirst_List()
        {
            //Arrange, Act
            int result = Vet.GetAll().Count;

            //Assert
            Assert.AreEqual(0, result);
        }
Пример #2
0
        public ActionResult Create(string vetName, string vetSpecialty)
        {
            Vet newVet = new Vet(vetName, vetSpecialty);

            newVet.Save();
            List <Vet> allVets = Vet.GetAll();

            return(View("Index", allVets));
        }
Пример #3
0
        public ActionResult Show(int id)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();
            Patient    selectedPatient        = Patient.Find(id);
            List <Vet> patientVets            = selectedPatient.GetVets();
            List <Vet> allVets = Vet.GetAll();

            model.Add("selectedPatient", selectedPatient);
            model.Add("patientVets", patientVets);
            model.Add("allVets", allVets);
            return(View(model));
        }
Пример #4
0
        public void Save_DatabaseAssignsIdToVet_Id()
        {
            //Arrange
            Vet testVet = new Vet("Doctor Phil", "Headstuff");

            testVet.Save();

            //Act
            Vet savedVet = Vet.GetAll()[0];

            int result = savedVet.Id;
            int testId = testVet.Id;

            //Assert
            Assert.AreEqual(testId, result);
        }
Пример #5
0
        public void Save_SavesVetToDatabase_VetList()
        {
            //Arrange
            Vet testVet = new Vet("Doctor Phil", "Headstuff");

            testVet.Save();

            //Act
            List <Vet> result   = Vet.GetAll();
            List <Vet> testList = new List <Vet> {
                testVet
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
Пример #6
0
        public void GetAll_ReturnsAllVetObjects_VetList()
        {
            //Arrange
            Vet newVet1 = new Vet("Doctor Bill", "Buttstuff");

            newVet1.Save();
            Vet newVet2 = new Vet("Doctor Phil", "Headstuff");

            newVet2.Save();
            List <Vet> newList = new List <Vet> {
                newVet1, newVet2
            };

            //Act
            List <Vet> result = Vet.GetAll();

            //Assert
            CollectionAssert.AreEqual(newList, result);
        }
Пример #7
0
        public ActionResult Index()
        {
            List <Vet> allVets = Vet.GetAll();

            return(View(allVets));
        }