public void RepairDamageTest() { DamageReportInputDto dto = DamageReportFactory.NewDamageReportInput(); string token = UsingDbContext(DamageReportsMockDatabaseHelper.AddAdminToContext); int id = _damageReportAppService.ReportDamage(dto, token).Id; string crewToken = UsingDbContext(DamageReportsMockDatabaseHelper.AddCrewToContext); _damageReportAppService.RepairDamage(crewToken, new DamageReportRepairDto { Id = id }); UsingDbContext(context => { DamageReport damage = context.DamageReports.Find(id); Assert.Equal(DamageStatus.Repaired, damage.Status); }); }
public DamageReportCompleteOutputDto RepairDamage(DamageReportRepairDto damage) { string token = Utillities.GetTokenFromRequest(Request); return(_damageAppService.RepairDamage(token, damage)); }