public async Task Should_Success_Delete_ById_SalesInvoice()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProviderMock();
            var service             = new MemoService(dbContext, serviceProviderMock.Object);
            var dataUtil            = new MemoDataUtil(service);
            var data = await dataUtil.GetCreatedSalesInvoiceData();

            var result = await service.DeleteAsync(data.Id);

            Assert.NotEqual(0, result);
        }
        public async Task Should_Success_MapToViewModel_SalesInvoice()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProviderMock();
            var service             = new MemoService(dbContext, serviceProviderMock.Object);
            var dataUtil            = new MemoDataUtil(service);
            var data = await dataUtil.GetCreatedSalesInvoiceData();

            var result = await service.ReadBySalesInvoiceAsync(data.SalesInvoiceNo);

            Assert.NotNull(result);
        }
        public async Task Should_Success_Read_Data_SalesInvoice()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProviderMock();
            var service             = new MemoService(dbContext, serviceProviderMock.Object);
            var dataUtil            = new MemoDataUtil(service);
            await dataUtil.GetCreatedSalesInvoiceData();

            var result = service.Read(1, 10, "{}", new List <string>(), "", "{}");

            Assert.NotEmpty(result.Data);
        }
        public async Task Should_Success_Create_Same_Buyer_SalesInvoice()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProviderMock();
            var service             = new MemoService(dbContext, serviceProviderMock.Object);
            var dataUtil            = new MemoDataUtil(service);
            await dataUtil.GetCreatedSalesInvoiceData();

            var modelToCreate = dataUtil.GetMemoModelToCreate_SalesInvoice();
            var result        = await service.CreateAsync(modelToCreate);

            Assert.NotEqual(0, result);
        }
        public async Task Should_Success_Update_Model_SalesInvoice()
        {
            var dbContext           = GetDbContext(GetCurrentMethod());
            var serviceProviderMock = GetServiceProviderMock();
            var service             = new MemoService(dbContext, serviceProviderMock.Object);
            var dataUtil            = new MemoDataUtil(service);
            var modelToUpdate       = await dataUtil.GetCreatedSalesInvoiceData();

            modelToUpdate.Items.Add(new MemoItemModel()
            {
                CurrencyCode  = "CurrencyCode",
                CurrencyId    = 1,
                CurrencyRate  = 1,
                Interest      = 1,
                PaymentAmount = 1
            });

            var result = await service.UpdateAsync(modelToUpdate.Id, modelToUpdate);

            Assert.NotEqual(0, result);
        }