示例#1
0
        /// <summary>
        /// Creator: Ethan Murphy
        /// Created: 2/7/2020
        /// Approver: Carl Davis 2/14/2020
        /// Approver: Chuck Baxter 2/14/2020
        ///
        /// Default constructor that initializes the fake vet appointment accessor
        /// and vet appointment manager, then retrieves a list of all vet appointments
        /// </summary>
        /// <remarks>
        /// Updater:
        /// Updated:
        /// Update:
        /// </remarks>
        public VetAppointmentManagerTests()
        {
            _vetAppointmentAccessor = new FakeVetAppointmentAccessor();
            IVetAppointmentManager vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor);

            _vetAppointments = vetAppointmentManager.RetrieveAllVetAppointments();
        }
示例#2
0
        public void TestVetAppointmentsManagerRetrieveInactiveAppointments()
        {
            // Arrange
            List <AnimalVetAppointment> vetAppointments;
            IVetAppointmentManager      vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor, _vetAppointments);

            // Act
            vetAppointments = vetAppointmentManager.RetrieveVetAppointmentsByActive(false);

            // Assert
            Assert.AreEqual(1, vetAppointments.Count);
        }
示例#3
0
        public void TestVetAppointmentManagerRetrieveAllAppointments()
        {
            // Arrange
            List <AnimalVetAppointment> vetAppointments;
            IVetAppointmentManager      vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor);

            // Act
            vetAppointments = vetAppointmentManager.RetrieveAllVetAppointments();

            // Assert
            Assert.AreEqual(3, vetAppointments.Count);
        }
示例#4
0
        public void TestRetrieveAnimalAppointmentsByPartialAninmalName()
        {
            // Arrange
            List <AnimalVetAppointment> vetAppointments;
            IVetAppointmentManager      vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor, _vetAppointments);

            // Act
            vetAppointments = vetAppointmentManager.RetrieveAppointmentsByPartialAnimalName("qwe");

            // Assert
            Assert.AreEqual(1, vetAppointments.Count);
        }
示例#5
0
        public void TestVetAppointmentsManagerRetrieveAppointmentsByVetName()
        {
            // Arrange
            List <AnimalVetAppointment> vetAppointments;
            IVetAppointmentManager      vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor, _vetAppointments);

            // Act
            vetAppointments = vetAppointmentManager.RetrieveAppointmentsByVetName("hstrth");

            // Assert
            Assert.AreEqual(1, vetAppointments.Count);
        }
示例#6
0
        public void TestVetAppointmentsManagerRetrieveAppointmentsByAppointmentDate()
        {
            // Arrange
            List <AnimalVetAppointment> vetAppointments;
            IVetAppointmentManager      vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor, _vetAppointments);

            // Act
            vetAppointments = vetAppointmentManager.RetrieveAppointmentsByDateTime(DateTime.Parse("3/1/2020 2:00PM"));

            // Assert
            Assert.AreEqual(1, vetAppointments.Count);
        }
示例#7
0
        public void TestVetAppointmentsManagerRetrieveAppointmentsByClinicAddress()
        {
            // Arrange
            List <AnimalVetAppointment> vetAppointments;
            IVetAppointmentManager      vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor, _vetAppointments);

            // Act
            vetAppointments = vetAppointmentManager.RetrieveAppointmentsByClinicAddress("1234 asdf");

            // Assert
            Assert.AreEqual(1, vetAppointments.Count);
        }
示例#8
0
        public void TestSelectVetAppointmentsByActive()
        {
            // Arrange
            List <AnimalVetAppointment> activeList;
            List <AnimalVetAppointment> inactiveList;
            IVetAppointmentManager      manager =
                new VetAppointmentManager(_vetAppointmentAccessor);

            // Act
            activeList   = manager.RetrieveVetAppointmentsByActive(true);
            inactiveList = manager.RetrieveVetAppointmentsByActive(false);

            // Assert
            Assert.AreEqual(2, activeList.Count);
            Assert.AreEqual(1, inactiveList.Count);
        }
示例#9
0
        public void TestActivatingRecord()
        {
            // Arrange
            bool result = false;
            IVetAppointmentManager manager =
                new VetAppointmentManager(_vetAppointmentAccessor);
            AnimalVetAppointment vetAppointment = new AnimalVetAppointment()
            {
                VetAppointmentID = 1,
                Active           = false
            };

            // Act
            result = manager.ActivateVetAppointment(vetAppointment);

            // Assert
            Assert.IsTrue(result);
        }
示例#10
0
        public void TestUpdateAnimalVetAppointmentRecord()
        {
            // Arrange
            bool result = false;
            IVetAppointmentManager vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor);
            AnimalVetAppointment   oldRecord             = new AnimalVetAppointment()
            {
                VetAppointmentID       = 1,
                AnimalID               = 1,
                AnimalName             = "qwerty",
                UserID                 = 1,
                AppointmentDateTime    = DateTime.Now,
                AppointmentDescription = "asdf",
                ClinicAddress          = "1234 asdf",
                VetName                = "awerga",
                FollowUpDateTime       = null,
                Active                 = true
            };
            AnimalVetAppointment newRecord = new AnimalVetAppointment()
            {
                VetAppointmentID       = 1,
                AnimalID               = 1,
                AnimalName             = "qwerty",
                UserID                 = 3,
                AppointmentDateTime    = DateTime.Now,
                AppointmentDescription = "awefuhioawefouh",
                ClinicAddress          = "1234 test",
                VetName                = "awerga",
                FollowUpDateTime       = DateTime.Now,
                Active                 = true
            };

            // Act
            vetAppointmentManager.AddAnimalVetAppointmentRecord(oldRecord);
            result = vetAppointmentManager.EditAnimalVetAppointmentRecord(oldRecord, newRecord);

            // Assert
            Assert.IsTrue(result);
        }
示例#11
0
        public void TestDeletingInValidAppointmentRecord()
        {
            // Arrange
            bool result = false;
            IVetAppointmentManager manager =
                new VetAppointmentManager(_vetAppointmentAccessor);
            AnimalVetAppointment vetAppointment = new AnimalVetAppointment()
            {
                VetAppointmentID       = 1,
                AnimalID               = 1,
                UserID                 = 10000,
                AppointmentDateTime    = DateTime.Now,
                AppointmentDescription = "test",
                ClinicAddress          = "test",
                VetName                = "test"
            };

            // Act
            result = manager.RemoveAnimalVetAppointment(vetAppointment);

            // Assert
            Assert.IsFalse(result);
        }
示例#12
0
        public void TestAddAnimalVetAppointmentRecord()
        {
            // Arrange
            bool result = false;
            IVetAppointmentManager vetAppointmentManager = new VetAppointmentManager(_vetAppointmentAccessor);
            AnimalVetAppointment   animalVetAppointment  = new AnimalVetAppointment()
            {
                AnimalID               = 4,
                VetAppointmentID       = 4,
                AnimalName             = "Test",
                UserID                 = 4,
                FollowUpDateTime       = null,
                AppointmentDateTime    = DateTime.Now,
                ClinicAddress          = "Test",
                VetName                = "Test",
                AppointmentDescription = "Test"
            };

            // Act
            result = vetAppointmentManager.AddAnimalVetAppointmentRecord(animalVetAppointment);

            // Assert
            Assert.IsTrue(result);
        }