Пример #1
0
        public void Test_AddSpecialty_AddsSpecialtyToDoctor()
        {
            //Arrange
            Doctor testDoctor = new Doctor("Nick");

            testDoctor.Save();

            Specialty testSpecialty = new Specialty("Ear");

            testSpecialty.Save();

            Specialty testSpecialty2 = new Specialty("Eye");

            testSpecialty2.Save();

            //Act
            testDoctor.AddSpecialty(testSpecialty);
            testDoctor.AddSpecialty(testSpecialty2);

            List <Specialty> result   = testDoctor.GetSpecialtys();
            List <Specialty> testList = new List <Specialty> {
                testSpecialty, testSpecialty2
            };

            //Assert
            CollectionAssert.AreEqual(testList, result);
        }
Пример #2
0
        public void GetSpecialtys_ReturnsAllDoctorSpecialtys_SpecialtyList()
        {
            //Arrange
            Doctor testDoctor = new Doctor("Joe");

            testDoctor.Save();

            Specialty testSpecialty1 = new Specialty("Phycologist");

            testSpecialty1.Save();

            Specialty testSpecialty2 = new Specialty("Eye");

            testSpecialty2.Save();

            //Act
            testDoctor.AddSpecialty(testSpecialty1);
            List <Specialty> savedSpecialtys = testDoctor.GetSpecialtys();
            List <Specialty> testList        = new List <Specialty> {
                testSpecialty1
            };

            //Assert
            CollectionAssert.AreEqual(testList, savedSpecialtys);
        }