Commit 29cbe034 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Fix: Fixed the Tests

parent fb64ff00
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<HintPath>..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll</HintPath> <HintPath>..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll</HintPath>
</Reference> </Reference>
<Reference Include="Coscine.Database, Version=1.22.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"> <Reference Include="Coscine.Database, Version=1.22.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.22.0-topic-858-quotaa0002\lib\net461\Coscine.Database.dll</HintPath> <HintPath>..\packages\Coscine.Database.1.22.0-sprint-2020-11-0007\lib\net461\Coscine.Database.dll</HintPath>
</Reference> </Reference>
<Reference Include="Coscine.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL"> <Reference Include="Coscine.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Logging.1.2.0\lib\net461\Coscine.Logging.dll</HintPath> <HintPath>..\packages\Coscine.Logging.1.2.0\lib\net461\Coscine.Logging.dll</HintPath>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<package id="Coscine.Action" version="1.13.0" targetFramework="net472" /> <package id="Coscine.Action" version="1.13.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.8.0" targetFramework="net472" /> <package id="Coscine.ApiCommons" version="1.8.0" targetFramework="net472" />
<package id="Coscine.Configuration" version="1.5.0" targetFramework="net472" /> <package id="Coscine.Configuration" version="1.5.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.22.0-topic-858-quotaa0002" targetFramework="net472" /> <package id="Coscine.Database" version="1.22.0-sprint-2020-11-0007" targetFramework="net472" />
<package id="Coscine.Logging" version="1.2.0" targetFramework="net472" /> <package id="Coscine.Logging" version="1.2.0" targetFramework="net472" />
<package id="Coscine.ProxyApi" version="1.2.1" targetFramework="net472" /> <package id="Coscine.ProxyApi" version="1.2.1" targetFramework="net472" />
<package id="EntityFramework" version="6.2.0" targetFramework="net472" /> <package id="EntityFramework" version="6.2.0" targetFramework="net472" />
......
...@@ -223,51 +223,42 @@ namespace Coscine.Api.Project.Controllers ...@@ -223,51 +223,42 @@ namespace Coscine.Api.Project.Controllers
} }
} }
var projectResourceModel = new ProjectResourceModel(); if (isHard)
ResourceModel resourceModel = new ResourceModel();
foreach (var projectResource in projectResourceModel.GetAllWhere((projectResource) => projectResource.ProjectId == project.Id))
{ {
if (isHard) var projectResourceModel = new ProjectResourceModel();
ResourceModel resourceModel = new ResourceModel();
foreach (var projectResource in projectResourceModel.GetAllWhere((projectResource) => projectResource.ProjectId == project.Id))
{ {
projectResourceModel.Delete(projectResource); projectResourceModel.Delete(projectResource);
resourceModel.Delete(resourceModel.GetById(projectResource.ResourceId)); resourceModel.Delete(resourceModel.GetById(projectResource.ResourceId));
} }
}
var projectRoleModel = new ProjectRoleModel(); var projectRoleModel = new ProjectRoleModel();
foreach (var projectRole in projectRoleModel.GetAllWhere((projectRole) => projectRole.ProjectId == project.Id)) foreach (var projectRole in projectRoleModel.GetAllWhere((projectRole) => projectRole.ProjectId == project.Id))
{
if (isHard)
{ {
projectRoleModel.Delete(projectRole); projectRoleModel.Delete(projectRole);
} }
}
var projectDisciplineModel = new ProjectDisciplineModel(); var projectDisciplineModel = new ProjectDisciplineModel();
foreach (var projectDiscipline in projectDisciplineModel.GetAllWhere((projectDiscipline) => projectDiscipline.ProjectId == project.Id)) foreach (var projectDiscipline in projectDisciplineModel.GetAllWhere((projectDiscipline) => projectDiscipline.ProjectId == project.Id))
{
if (isHard)
{ {
projectDisciplineModel.Delete(projectDiscipline); projectDisciplineModel.Delete(projectDiscipline);
} }
}
var projectInstituteModel = new ProjectInstituteModel(); var projectInstituteModel = new ProjectInstituteModel();
foreach (var projectInstitute in projectInstituteModel.GetAllWhere((projectInstitute) => projectInstitute.ProjectId == project.Id)) foreach (var projectInstitute in projectInstituteModel.GetAllWhere((projectInstitute) => projectInstitute.ProjectId == project.Id))
{
if (isHard)
{ {
projectInstituteModel.Delete(projectInstitute); projectInstituteModel.Delete(projectInstitute);
}
var projectQuotaModel = new ProjectQuotaModel();
foreach (var projectQuota in projectQuotaModel.GetAllWhere((Quota) => Quota.ProjectId == project.Id))
{
projectQuotaModel.Delete(projectQuota);
} }
}
if(isHard)
{
_activatedFeaturesModel.DeactivateAllFeatures(project); _activatedFeaturesModel.DeactivateAllFeatures(project);
}
if (isHard)
{
if (propegateAction) if (propegateAction)
{ {
_emitter.EmitProjectDelete(new ProjectEventArgs(_configuration) _emitter.EmitProjectDelete(new ProjectEventArgs(_configuration)
...@@ -275,12 +266,9 @@ namespace Coscine.Api.Project.Controllers ...@@ -275,12 +266,9 @@ namespace Coscine.Api.Project.Controllers
Project = project Project = project
}); });
} }
}
if (isHard)
{
_projectModel.HardDelete(project); _projectModel.HardDelete(project);
} }
else else
{ {
_projectModel.Delete(project); _projectModel.Delete(project);
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<HintPath>..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll</HintPath> <HintPath>..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll</HintPath>
</Reference> </Reference>
<Reference Include="Coscine.Database, Version=1.22.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"> <Reference Include="Coscine.Database, Version=1.22.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Database.1.22.0-topic-858-quotaa0002\lib\net461\Coscine.Database.dll</HintPath> <HintPath>..\packages\Coscine.Database.1.22.0-sprint-2020-11-0007\lib\net461\Coscine.Database.dll</HintPath>
</Reference> </Reference>
<Reference Include="Coscine.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL"> <Reference Include="Coscine.Logging, Version=1.2.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL">
<HintPath>..\packages\Coscine.Logging.1.2.0\lib\net461\Coscine.Logging.dll</HintPath> <HintPath>..\packages\Coscine.Logging.1.2.0\lib\net461\Coscine.Logging.dll</HintPath>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<package id="Coscine.Action" version="1.13.0" targetFramework="net472" /> <package id="Coscine.Action" version="1.13.0" targetFramework="net472" />
<package id="Coscine.ApiCommons" version="1.8.0" targetFramework="net472" /> <package id="Coscine.ApiCommons" version="1.8.0" targetFramework="net472" />
<package id="Coscine.Configuration" version="1.5.0" targetFramework="net472" /> <package id="Coscine.Configuration" version="1.5.0" targetFramework="net472" />
<package id="Coscine.Database" version="1.22.0-topic-858-quotaa0002" targetFramework="net472" /> <package id="Coscine.Database" version="1.22.0-sprint-2020-11-0007" targetFramework="net472" />
<package id="Coscine.Logging" version="1.2.0" targetFramework="net472" /> <package id="Coscine.Logging" version="1.2.0" targetFramework="net472" />
<package id="Coscine.ProxyApi" version="1.2.1" targetFramework="net472" /> <package id="Coscine.ProxyApi" version="1.2.1" targetFramework="net472" />
<package id="EntityFramework" version="6.2.0" targetFramework="net472" /> <package id="EntityFramework" version="6.2.0" targetFramework="net472" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment