public async Task CreateMarriageDocsAsync_ShouldThrowDomainException_WhenRelationIsNotValid() { // Arrange CreateMockedObjects(out mockLogger, out mockDocRepo, out mockCachedLookupsService); var docService = new MarriageDocService(mockDocRepo.Object, mockLogger.Object, mockCachedLookupsService.Object); //Act //Action result = async () => await docService.CreateMarriageDocsAsync(GetTestDocs()); //Assert await Assert.ThrowsAsync <DomainException>(async() => await docService.CreateMarriageDocsAsync(GetFakeInvalidDocs())); }
public async Task CreateMarriageDocsAsync_ShouldSetPriceEquals100() { // Arrange CreateMockedObjects(out mockLogger, out mockDocRepo, out mockCachedLookupsService); var docService = new MarriageDocService(mockDocRepo.Object, mockLogger.Object, mockCachedLookupsService.Object); //Act var result = await docService.CreateMarriageDocsAsync(GetFakeValidDocs()); //Assert Assert.IsAssignableFrom <IEnumerable <MarriageDocResponse> >(result); Assert.Equal(100, result.First().MarriageDoc.Price); }
public async Task GetDocPrice_ReturnsDocPrice() { // Arrange decimal defaultPrice = 100; CreateMockedObjects(out mockLogger, out mockDocRepo, out mockCachedLookupsService); var docService = new MarriageDocService(mockDocRepo.Object, mockLogger.Object, mockCachedLookupsService.Object); //Act var result = await docService.GetDocPrice(); //Assert Assert.Equal(defaultPrice, result); }