Пример #1
0
        public async Task Should_Success_Posting()
        {
            //Arrange
            var dbContex        = GetDbContext(GetCurrentAsyncMethod());
            var serviceProvider = GetServiceProvider();

            serviceProvider
            .Setup(x => x.GetService(typeof(IHttpClientService)))
            .Returns(new HttpClientTestService());

            serviceProvider
            .Setup(s => s.GetService(typeof(FinanceDbContext)))
            .Returns(dbContex);

            DPPVATBankExpenditureNoteService service = new DPPVATBankExpenditureNoteService(serviceProvider.Object);
            var data = await _dataUtil(service).GetTestData();

            var newForm = _dataUtil(service).GetNewForm();

            //Act
            var response = await service.Posting(new List <int>() { 1 });

            //Assert
            Assert.NotEqual(0, response);
        }
        public async Task Should_Success_Posting()
        {
            var dbContext = GetDbContext(GetCurrentMethod());

            var serviceProviderMock = GetServiceProvider(dbContext);

            var service = new DPPVATBankExpenditureNoteService(serviceProviderMock.Object);

            var id = await service.Create(GetForm());

            var result = await service.Posting(new List <int>() { id });

            Assert.NotEqual(0, result);
        }