public async Task CreateBirthDocsAsync_ShouldThrowDomainException_WhenRelationIsNotValid() { // Arrange CreateMockedObjects(out mockLogger, out mockBirthDocRepo, out mockCachedLookupsService); var docService = new BirthDocService(mockBirthDocRepo.Object, mockLogger.Object, mockCachedLookupsService.Object); //Act //Action result = async () => await docService.CreateBirthDocsAsync(GetTestDocs()); //Assert await Assert.ThrowsAsync <DomainException>(async() => await docService.CreateBirthDocsAsync(GetFakeInvalidBirthDocs())); }
public async Task CreateBirthDocsAsync_ShouldSetNidToDefaultValueWhenTheDocIsFirstTime() { // Arrange CreateMockedObjects(out mockLogger, out mockBirthDocRepo, out mockCachedLookupsService); var docService = new BirthDocService(mockBirthDocRepo.Object, mockLogger.Object, mockCachedLookupsService.Object); //Act var result = await docService.CreateBirthDocsAsync(GetFakeValidBirthDocsForFirstTime()); //Assert Assert.IsAssignableFrom <IEnumerable <BirthDocResponse> >(result); Assert.Equal(Constants.DEFAULT_NID_NUMBER, result.First().BirthDoc.NID.NationalIdenNumber); }
public async Task CreateBirthDocsAsync_ShouldSetPriceEquals100() { // Arrange CreateMockedObjects(out mockLogger, out mockBirthDocRepo, out mockCachedLookupsService); var docService = new BirthDocService(mockBirthDocRepo.Object, mockLogger.Object, mockCachedLookupsService.Object); //Act var result = await docService.CreateBirthDocsAsync(GetFakeValidBirthDocs()); //Assert Assert.IsAssignableFrom <IEnumerable <BirthDocResponse> >(result); Assert.Equal(100, result.First().BirthDoc.Price); }