public async Task WhenAddingContactInfoToNonExistingCustomer_ShouldReturnNotFound() { var contactInfoItem = ApiDtoGenerator.ContactInfoItemGenerator(); var apiResult = await _sut.Put(_notExistingId, contactInfoItem); Assert.IsType <NotFoundResult>(apiResult.Result); }
public async Task WhenAddingValidContactDataToACustomer_ItShouldReturnOIk() { var contactInfoItem = ApiDtoGenerator.ContactInfoItemGenerator(); var apiResult = await _sut.Put(_existingId, contactInfoItem); Assert.IsType <OkResult>(apiResult.Result); }
public async Task WhenAddingDuplicateContactDataToACustomer_ItShouldReturnBadRequest() { var contactInfoItem1 = ApiDtoGenerator.ContactInfoItemGenerator().Generate(); var apiResult1 = await _sut.Put(_existingId, contactInfoItem1); Assert.IsType <OkResult>(apiResult1.Result); var apiResult2 = await _sut.Put(_existingId, contactInfoItem1); Assert.IsType <BadRequestObjectResult>(apiResult2.Result); }
public void WhenMap_Dto_To_Entity_ShouldAllPropertiesMapped() { var faker = ApiDtoGenerator.ContactInfoItemGenerator(); var item = faker.Generate(); var entity = _sut.Map(item); using (new AssertionScope()) { item.Type.Should().Be(entity.Type); item.Value.Should().Be(entity.Value); } }