public async Task Given_Patient_Posts_And_Returns_201_Code() { var currentDateTime = DateTime.Now; var patientDto = new PatientDto { Name = "name", Bsn = "Bsn", Email = "test", Dob = currentDateTime, Gender = Gender.Male, PhoneNumber = "1321", City = "hank", Street = "lepelaarstraat20", HouseNumber = "20", PostalCode = "23", Country = "qwe" }; var patient = new Patient { Name = "name", Bsn = "Bsn", Email = "test", Dob = currentDateTime, Gender = Gender.Male, PhoneNumber = "1321", City = "hank", Street = "lepelaarstraat20", HouseNumber = "20", PostalCode = "23", Country = "qwe" }; var lengthBefore = _fakeUsersPatient.Count; var result = await FakeController.Post(patientDto); var objActionResult = (CreatedAtActionResult)result.Result; var createdPatient = _fakeUsersPatient[lengthBefore]; Assert.Equal(lengthBefore + 1, _fakeUsersPatient.Count); Assert.Equal(201, objActionResult.StatusCode); Assert.Equal(patient.Name, createdPatient.Name); Assert.Equal(patient.Bsn, createdPatient.Bsn); Assert.Equal(patient.Email, createdPatient.Email); Assert.Equal(patient.Dob, createdPatient.Dob); Assert.Equal(patient.Gender, createdPatient.Gender); Assert.Equal(patient.PhoneNumber, createdPatient.PhoneNumber); Assert.Equal(patient.City, createdPatient.City); Assert.Equal(patient.Street, createdPatient.Street); Assert.Equal(patient.HouseNumber, createdPatient.HouseNumber); Assert.Equal(patient.PostalCode, createdPatient.PostalCode); Assert.Equal(patient.Country, createdPatient.Country); }
public async Task Given_Consultation_Posts_And_Returns_201_Code() { var entity = new ConsultationDto { Comments = "comments", Date = DateTime.Now, PatientId = _patients[0].Id, DoctorId = Guid.Parse(_fakeIdentityUsers[0].Id) }; var lengthBefore = _fakeEntities.Count; var result = await FakeController.Post(entity); var objActionResult = (CreatedAtActionResult)result.Result; Assert.Equal(lengthBefore + 1, _fakeEntities.Count); Assert.Equal(201, objActionResult.StatusCode); }
public async Task Given_Episode_Posts_And_Returns_201_Code() { var entity = new EpisodeDto { Description = "NewDesc" }; var lengthBefore = _fakeEntities.Count; var result = await FakeController.Post(entity); var objActionResult = (CreatedAtActionResult)result.Result; var createdPatient = _fakeEntities[lengthBefore]; Assert.Equal(lengthBefore + 1, _fakeEntities.Count); Assert.Equal(201, objActionResult.StatusCode); Assert.Equal(createdPatient.Description, entity.Description); }
public async Task Given_Prescription_Posts_And_Returns_201_Code() { var entity = new PrescriptionDto { Description = "DEDEDE", StartDate = DateTime.Now, EndDate = DateTime.Now, ConsultationId = _constulatations[0].Id, PatientId = _patients[0].Id }; var lengthBefore = _fakeEntities.Count; var result = await FakeController.Post(entity); var objActionResult = (CreatedAtActionResult)result.Result; Assert.Equal(lengthBefore + 1, _fakeEntities.Count); Assert.Equal(201, objActionResult.StatusCode); }
public async Task Given_AdditionalExaminationResult_Posts_And_Returns_201_Code() { var entity = new AdditionalExaminationResultDto { Value = "value", Date = DateTime.Now, ConsultationId = _consultations[0].Id }; var lengthBefore = _fakeEntities.Count; var result = await FakeController.Post(entity); var objActionResult = (CreatedAtActionResult)result.Result; var createdEntity = _fakeEntities[lengthBefore]; Assert.Equal(lengthBefore + 1, _fakeEntities.Count); Assert.Equal(201, objActionResult.StatusCode); Assert.Equal(createdEntity.Date, entity.Date); Assert.Equal(createdEntity.Value, entity.Value); }
public async Task Given_AdditionalExaminationType_Posts_And_Returns_201_Code() { var entity = new AdditionalExaminationTypeDto { Name = "Naamm", Unit = "Unitt" }; var lengthBefore = _fakeEntities.Count; var result = await FakeController.Post(entity); var objActionResult = (CreatedAtActionResult)result.Result; var createdPatient = _fakeEntities[lengthBefore]; Assert.Equal(lengthBefore + 1, _fakeEntities.Count); Assert.Equal(201, objActionResult.StatusCode); Assert.Equal(createdPatient.Name, entity.Name); Assert.Equal(createdPatient.Unit, entity.Unit); }