public async Task Should_Success_Create_Data()
        {
            //Arrange
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProvider();

            var IVBRealizationDocumentExpeditionServiceMock = new Mock <IVBRealizationDocumentExpeditionService>();

            IVBRealizationDocumentExpeditionServiceMock.Setup(s => s.InitializeExpedition(It.IsAny <int>())).ReturnsAsync(1);

            serviceProviderMock.Setup(serviceProvider => serviceProvider.GetService(typeof(IVBRealizationDocumentExpeditionService))).Returns(IVBRealizationDocumentExpeditionServiceMock.Object);
            serviceProviderMock.Setup(serviceProvider => serviceProvider.GetService(typeof(IHttpClientService))).Returns(new HttpClientOthersExpenditureServiceHelper());

            RealizationVbWithPOService service = new RealizationVbWithPOService(dbContext, serviceProviderMock.Object);
            RealizationVbModel         model   = _dataUtil(service).GetNewData();

            var dataRequestVb = _dataUtil(service).GetDataRequestVB();
            RealizationVbWithPOViewModel viewModel = _dataUtil(service).GetNewViewModel();

            //Act
            var Response = await service.CreateAsync(model, viewModel);

            //Assert
            Assert.NotEqual(0, Response);
        }
        public async Task Read_Return_Success()
        {
            //Arrange
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProvider();

            var IVBRealizationDocumentExpeditionServiceMock = new Mock <IVBRealizationDocumentExpeditionService>();

            serviceProviderMock.Setup(serviceProvider => serviceProvider.GetService(typeof(IVBRealizationDocumentExpeditionService))).Returns(IVBRealizationDocumentExpeditionServiceMock.Object);
            serviceProviderMock.Setup(serviceProvider => serviceProvider.GetService(typeof(IHttpClientService))).Returns(new HttpClientOthersExpenditureServiceHelper());

            RealizationVbWithPOService service = new RealizationVbWithPOService(dbContext, serviceProviderMock.Object);

            RealizationVbModel model = _dataUtil(service).GetNewData();


            RealizationVbWithPOViewModel viewModel = _dataUtil(service).GetNewViewModel();
            await service.CreateAsync(model, viewModel);

            //Act
            var response = service.Read(1, 1, "{}", new List <string>(), "", "{}");

            //Assert
            Assert.NotNull(response);
        }
        public async Task Should_Success_Create_Data_Mapping()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProvider();
            var IVBRealizationDocumentExpeditionServiceMock = new Mock <IVBRealizationDocumentExpeditionService>();

            serviceProviderMock.Setup(serviceProvider => serviceProvider.GetService(typeof(IVBRealizationDocumentExpeditionService))).Returns(IVBRealizationDocumentExpeditionServiceMock.Object);
            serviceProviderMock.Setup(serviceProvider => serviceProvider.GetService(typeof(IHttpClientService))).Returns(new HttpClientOthersExpenditureServiceHelper());
            RealizationVbWithPOService service = new RealizationVbWithPOService(dbContext, serviceProviderMock.Object);
            RealizationVbModel         model   = _dataUtil(service).GetNewData();

            RealizationVbWithPOViewModel viewModel = _dataUtil(service).GetNewViewModel();
            await service.CreateAsync(model, viewModel);

            var Response = await service.MappingData(viewModel);

            Assert.NotEqual(0, Response);
        }
        public async Task ReadByIdAsync2_Return_Success()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProvider();

            serviceProviderMock.Setup(serviceProvider => serviceProvider.GetService(typeof(IVBRealizationDocumentExpeditionService))).Returns(new RealizationVbWithPOServiceHelper());
            serviceProviderMock.Setup(serviceProvider => serviceProvider.GetService(typeof(IHttpClientService))).Returns(new HttpClientOthersExpenditureServiceHelper());
            RealizationVbWithPOService service = new RealizationVbWithPOService(dbContext, serviceProviderMock.Object);
            RealizationVbModel         model   = _dataUtil(service).GetNewData();

            var dataRequestVb = _dataUtil(service).GetDataRequestVB();

            dbContext.VbRequests.Add(dataRequestVb);
            dbContext.SaveChanges();

            RealizationVbWithPOViewModel viewModel = _dataUtil(service).GetNewViewModel();
            await service.CreateAsync(model, viewModel);

            var response = await service.ReadByIdAsync2(model.Id);

            Assert.NotNull(response);
        }