예제 #1
0
        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()));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public async Task GetDocPrice_ReturnsDocPrice()
        {
            // Arrange
            decimal defaultPrice = 100;

            CreateMockedObjects(out mockLogger, out mockBirthDocRepo, out mockCachedLookupsService);
            var docService = new BirthDocService(mockBirthDocRepo.Object, mockLogger.Object, mockCachedLookupsService.Object);

            //Act
            var result = await docService.GetDocPrice();

            //Assert
            Assert.Equal(defaultPrice, result);
        }