Skip to content

Commit

Permalink
Updated approval tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcelhanon committed Feb 13, 2024
1 parent 9a1ebb8 commit 7d9fe22
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 138 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,13 @@ public static void MapTo(this ISchool source, ISchool target, Action<ISchool, IS

if (!(mappingContract?.IsSchoolAddressCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetSchoolAddress = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -1098,9 +1102,13 @@ public static void MapTo(this IStudent source, IStudent target, Action<IStudent,

if (!(mappingContract?.IsStudentAddressCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetStudentAddress = Activator.CreateInstance(itemType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2132,9 +2132,13 @@ public static void MapTo(this IParentExtension source, IParentExtension target,

if (!(mappingContract?.IsParentCTEProgramCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetParentCTEProgram = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -2163,9 +2167,13 @@ public static void MapTo(this IParentExtension source, IParentExtension target,

if (!(mappingContract?.IsParentTeacherConferenceCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetParentTeacherConference = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -2768,9 +2776,13 @@ public static void MapTo(this ISchoolExtension source, ISchoolExtension target,

if (!(mappingContract?.IsSchoolCTEProgramCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetSchoolCTEProgram = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -2937,9 +2949,13 @@ public static void MapTo(this IStaffExtension source, IStaffExtension target, Ac

if (!(mappingContract?.IsStaffPetPreferenceCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetStaffPetPreference = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -3366,9 +3382,13 @@ public static void MapTo(this IStudentExtension source, IStudentExtension target

if (!(mappingContract?.IsStudentPetPreferenceCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetStudentPetPreference = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -4094,9 +4114,13 @@ public static void MapDerivedTo(this IStudentArtProgramAssociation source, IStud

if (!(mappingContract?.IsGeneralStudentProgramAssociationParticipationStatusCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetGeneralStudentProgramAssociationParticipationStatus = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -5381,9 +5405,13 @@ public static void MapTo(this IStudentGraduationPlanAssociation source, IStudent

if (!(mappingContract?.IsStudentGraduationPlanAssociationCTEProgramCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetStudentGraduationPlanAssociationCTEProgram = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -6411,9 +6439,13 @@ public static void MapTo(this IStudentParentAssociationExtension source, IStuden

if (!(mappingContract?.IsStudentParentAssociationTelephoneCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetStudentParentAssociationTelephone = Activator.CreateInstance(itemType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5525,9 +5525,13 @@ public static void MapTo(this IEvaluationRatingReviewer source, IEvaluationRatin

if (!(mappingContract?.IsEvaluationRatingReviewerReceivedTrainingCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetEvaluationRatingReviewerReceivedTraining = Activator.CreateInstance(itemType);
Expand Down Expand Up @@ -7275,9 +7279,13 @@ public static void MapTo(this IPerformanceEvaluationRatingReviewer source, IPerf

if (!(mappingContract?.IsPerformanceEvaluationRatingReviewerReceivedTrainingCreatable ?? true))
{
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;

throw new DataPolicyException(profileName, itemType.Name);
// If no potential data policy violation has been detected yet
if (GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Get() == null)
{
// Make note of this potential data policy violation using context
string profileName = GeneratedArtifactStaticDependencies.ProfileContentTypeContextProvider.Get().ProfileName;
GeneratedArtifactStaticDependencies.DataPolicyExceptionContextProvider.Set(new DataPolicyException(profileName, itemType.Name));
}
}

object targetPerformanceEvaluationRatingReviewerReceivedTraining = Activator.CreateInstance(itemType);
Expand Down
Loading

0 comments on commit 7d9fe22

Please sign in to comment.