Example #1
0
        public void GetAll_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new AppointmentHitchayvutRepository(context);

            // Act
            IEnumerable <appointment_hitchayvut> result = repository.GetAll();

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(context.appointment_hitchayvut.Count(), result.Count());
        }
Example #2
0
        public void GetAllFilterByAppointment_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository    = new AppointmentHitchayvutRepository(context);
            int appointmentId = 1;

            // Act
            IEnumerable <appointment_hitchayvut> result = repository.GetAllFilterByAppointment(appointmentId);

            // Assert
            Assert.AreEqual(context.appointment_hitchayvut.Where(x => x.appointmentId == appointmentId).Count(), result.Count());
            Assert.AreEqual(result.Where(x => x.appointmentId == appointmentId).Count(), result.Count());
        }
Example #3
0
        public void GetById_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository = new AppointmentHitchayvutRepository(context);
            int id         = 1;

            // Act
            appointment_hitchayvut result = repository.GetById(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(id, result.id);
        }
        public void GetById_Test()
        {
            // Arrange
            TestKolgraphEntities context = new TestKolgraphEntities();
            var repository        = new AppointmentHitchayvutRepository(context);
            var hitchayvutService = new HitchayvutService();
            var service           = new AppointmentHitchayvutService(repository, hitchayvutService);
            int id = 1;

            // Act
            AppointmentHitchayvutModel result = service.GetById(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(id, result.Id);
        }