public async Task Should_Success_Delete_Acceptance_Cashier()
        {
            PurchasingDispositionExpeditionService service = new PurchasingDispositionExpeditionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var model = await _dataUtil(service).GetTestData();

            PurchasingDispositionAcceptanceViewModel data = new PurchasingDispositionAcceptanceViewModel()
            {
                Role = "CASHIER",
                PurchasingDispositionExpedition = new List <PurchasingDispositionAcceptanceItemViewModel>()
                {
                    new PurchasingDispositionAcceptanceItemViewModel()
                    {
                        DispositionNo = model.DispositionNo,
                        Id            = model.Id
                    }
                }
            };
            var acceptedResponse = await service.PurchasingDispositionAcceptance(data);

            var newModel = await service.ReadByIdAsync(model.Id);

            var deleteResponse = await service.DeletePurchasingDispositionAcceptance(newModel.Id);

            Assert.NotEqual(0, deleteResponse);
        }
        public async Task Should_Fail_Post_Acceptance_Verification()
        {
            PurchasingDispositionExpeditionService service = new PurchasingDispositionExpeditionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            PurchasingDispositionExpeditionModel   model   = await _dataUtil(service).GetTestData();

            PurchasingDispositionAcceptanceViewModel data = new PurchasingDispositionAcceptanceViewModel()
            {
                Role = "VERIFICATION",
                PurchasingDispositionExpedition = new List <PurchasingDispositionAcceptanceItemViewModel>()
                {
                    new PurchasingDispositionAcceptanceItemViewModel()
                    {
                        DispositionNo = model.DispositionNo,
                        Id            = model.Id
                    }
                }
            };
            await Assert.ThrowsAnyAsync <Exception>(() => service.PurchasingDispositionAcceptance(null));
        }
        public async Task Should_Success_Post_Acceptance_Verification()
        {
            PurchasingDispositionExpeditionService service = new PurchasingDispositionExpeditionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            PurchasingDispositionExpeditionModel   model   = await _dataUtil(service).GetTestData();

            PurchasingDispositionAcceptanceViewModel data = new PurchasingDispositionAcceptanceViewModel()
            {
                Role = "VERIFICATION",
                PurchasingDispositionExpedition = new List <PurchasingDispositionAcceptanceItemViewModel>()
                {
                    new PurchasingDispositionAcceptanceItemViewModel()
                    {
                        DispositionNo = model.DispositionNo,
                        Id            = model.Id
                    }
                }
            };

            var response = await service.PurchasingDispositionAcceptance(data);

            Assert.NotEqual(0, response);
        }
        public async Task Should_Fail_Delete_Acceptance()
        {
            PurchasingDispositionExpeditionService service = new PurchasingDispositionExpeditionService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var model = await _dataUtil(service).GetTestData();

            PurchasingDispositionAcceptanceViewModel data = new PurchasingDispositionAcceptanceViewModel()
            {
                Role = "CASHIER",
                PurchasingDispositionExpedition = new List <PurchasingDispositionAcceptanceItemViewModel>()
                {
                    new PurchasingDispositionAcceptanceItemViewModel()
                    {
                        DispositionNo = model.DispositionNo,
                        Id            = model.Id
                    }
                }
            };
            var acceptedResponse = await service.PurchasingDispositionAcceptance(data);

            var newModel = await service.ReadByIdAsync(model.Id);

            service = new PurchasingDispositionExpeditionService(GetServiceProviderWrongHttpClient().Object, _dbContext(GetCurrentMethod()));
            await Assert.ThrowsAnyAsync <Exception>(() => service.DeletePurchasingDispositionAcceptance(newModel.Id));
        }