Пример #1
0
        public async Task <PaymentDispositionNoteModel> GetTestData()
        {
            PaymentDispositionNoteModel model = GetNewData();
            await Service.CreateAsync(model);

            return(await Service.ReadByIdAsync(model.Id));
        }
        public async Task Should_Success_Create_Data()
        {
            PaymentDispositionNoteService service = new PaymentDispositionNoteService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            PaymentDispositionNoteModel   model   = _dataUtil(service, GetCurrentMethod()).GetNewData();
            var Response = await service.CreateAsync(model);

            Assert.NotEqual(0, Response);
        }
        public async Task <PaymentDispositionNotePostDto> GetNewPostDto()
        {
            PaymentDispositionNoteModel model = GetNewData();
            await Service.CreateAsync(model);

            var read = await Service.ReadByIdAsync((int)model.Id);

            return(new PaymentDispositionNotePostDto
            {
                ListIds = new List <PaymentDispositionNotePostIdDto>
                {
                    new PaymentDispositionNotePostIdDto {
                        Id = read.Id
                    }
                }
            });
        }
        public async Task Should_Success_Get_Report()
        {
            try
            {
                PaymentDispositionNoteService service = new PaymentDispositionNoteService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
                PaymentDispositionNoteModel   model   = _dataUtil(service, GetCurrentMethod()).GetNewData();
                await service.CreateAsync(model);

                var item   = model.Items.FirstOrDefault();
                var result = service.GetReport(model.Id, item.DispositionId, model.SupplierId, item.DivisionId, DateTimeOffset.MinValue, DateTimeOffset.MaxValue);

                Assert.NotEmpty(result);
            }
            catch (Exception e)
            {
            }
        }