Beispiel #1
0
        public void Test_Find_FindsPatientInDatabase()
        {
            Patient testPatient = new Patient("Minh", "June 30 1993", 5);

            testPatient.Save();

            Patient foundPatient = Patient.Find(testPatient.GetId());

            Assert.Equal(testPatient, foundPatient);
        }
Beispiel #2
0
        public void Test_Save_AssignsIdToObject()
        {
            //Arrange
            Patient testPatient = new Patient("John", "April 1 1954", 5);

            //Act
            testPatient.Save();
            Patient savedPatient = Patient.GetAll()[0];

            int result = savedPatient.GetId();
            int testId = testPatient.GetId();

            //Assert
            Assert.Equal(testId, result);
        }