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));
        }
        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);
        }
Beispiel #3
0
        public DamageReportOutputDto ReportDamage(DamageReportInputDto damage)
        {
            string token = Utillities.GetAuthTokenOrNullIfException(Request);

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