コード例 #1
0
        public void SaveAndGetAll_SavesToDatabaseAndReturnAll_Specialties()
        {
            //Arrange
            Specialties testSpecialty = new Specialties("testName");

            //Act
            testSpecialty.Save();
            List <Specialties> result   = Specialties.GetAll();
            List <Specialties> testList = new List <Specialties> {
                testSpecialty
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
コード例 #2
0
        public void Save_AssignsIdToObject_Id()
        {
            //Arrange
            Specialties testSpecialty = new Specialties("testName");

            //Act
            testSpecialty.Save();
            Specialties savedSpecialty = Specialties.GetAll()[0];

            int result = savedSpecialty.GetId();
            int testId = testSpecialty.GetId();

            //Assert
            Assert.AreEqual(testId, result);
        }
コード例 #3
0
        public ActionResult Index()
        {
            List <Specialties> allSpecialties = Specialties.GetAll();

            return(View(allSpecialties));
        }