Exemplo n.º 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()));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }