public void ModifyDamageReportTests()
        {
            DamageReport dr = DamageReportFactory.NewDamageReport();

            string token = UsingDbContext(context => DamageReportsMockDatabaseHelper.AddDamageReport(dr, context));

            _damageReportAppService.ModifyDamageReport(token, dr.Id, new ModifyDamageReportDto
            {
                Priority = DamageReportPriorityDto.High,
                Status   = DamageStatusDto.Accepted
            });

            UsingDbContext(context =>
            {
                DamageReport savedDamage = context.DamageReports.First();

                Assert.Equal(DamagePriority.High, savedDamage.Priority);
                Assert.Equal(DamageStatus.Accepted, savedDamage.Status);
            });
        }
Beispiel #2
0
        public DamageReportCompleteOutputDto ModifyDamageReport(int id, ModifyDamageReportDto modifiedDamage)
        {
            string token = Utillities.GetTokenFromRequest(Request);

            return(_damageAppService.ModifyDamageReport(token, id, modifiedDamage));
        }