Пример #1
0
        public void DeleteDamageReport()
        {
            DamageReportInputDto dto = DamageReportFactory.NewDamageReportInput();

            string token = UsingDbContext(DamageReportsMockDatabaseHelper.AddAdminToContext);

            DamageReportOutputDto result = _damageReportAppService.ReportDamage(dto, token);

            _damageReportAppService.DeleteDamage(token, result.Id);

            UsingDbContext(context => Assert.Empty(context.DamageReports));
        }
Пример #2
0
        public void ReportDamageTest()
        {
            DamageReportInputDto dto = DamageReportFactory.NewDamageReportInput();

            string token = UsingDbContext(DamageReportsMockDatabaseHelper.AddAdminToContext);

            DamageReportOutputDto result = _damageReportAppService.ReportDamage(dto, token);

            UsingDbContext(context =>
            {
                Assert.Equal(dto.Description, context.DamageReports.First().Description);
            });

            Assert.Equal(result.Description, dto.Description);
        }
Пример #3
0
        public DamageReportOutputDto ReportDamage(DamageReportInputDto damage)
        {
            string token = Utillities.GetAuthTokenOrNullIfException(Request);

            return(_damageAppService.ReportDamage(damage, token));
        }