Exemplo n.º 1
0
        public void GetAppointmentTypeById_NotNullResponse_Test()
        {
            //Arrage
            IDbContext  dbContext  = new MedicalAppointmentContext();
            IRepository repository = new AppointmentTypeRepository(dbContext);
            var         sut        = new AppointmentTypesController(repository);

            //Act
            var result = sut.Get(1) as OkNegotiatedContentResult <IAppointmentType>;
            var appointmentTypeResult = result.Content as AppointmentType;

            //Assert
            Assert.IsNotNull(result);
            Assert.IsNotNull(appointmentTypeResult);
        }
Exemplo n.º 2
0
        public void GetAppointmentTypeById_ValidDataResponse_Test()
        {
            //Arrage
            IDbContext  dbContext      = new MedicalAppointmentContext();
            IRepository repository     = new AppointmentTypeRepository(dbContext);
            var         sut            = new AppointmentTypesController(repository);
            var         expectedResult = new AppointmentType()
            {
                Id = 1, Name = "Medicina General"
            };

            //Act
            var result = sut.Get(1) as OkNegotiatedContentResult <IAppointmentType>;
            var appointmentTypeResult = result.Content as AppointmentType;

            //Assert
            Assert.AreEqual(expectedResult.Id, appointmentTypeResult.Id);
            Assert.AreEqual(expectedResult.Name, appointmentTypeResult.Name);
        }