public void GetMissingRequiredPoliciesShouldBeEmptyWhenAllRequiredKnown() { var serverPoliciesAllRequiredKnown = new Dictionary <string, SecurityPolicyState> { { "record_sql", DisabledRequiredState }, { "attributes_include", DisabledRequiredState }, { "allow_raw_exception_messages", DisabledRequiredState }, { "custom_events", DisabledRequiredState }, { "custom_parameters", DisabledRequiredState }, { "custom_instrumentation_editor", DisabledRequiredState }, { "dotnet_unknown_setting", DisabledOptionalState } }; var missingRequiredPolicies = SecurityPoliciesConfiguration.GetMissingRequiredPolicies(serverPoliciesAllRequiredKnown); Assert.IsEmpty(missingRequiredPolicies); }
public void GetMissingRequiredPoliciesShouldContainMissingRequiredPolicies() { var serverPoliciesAllRequiredKnown = new Dictionary <string, SecurityPolicyState> { { "record_sql", DisabledRequiredState }, { "attributes_include", DisabledRequiredState }, { "allow_raw_exception_messages", DisabledRequiredState }, { "custom_events", DisabledRequiredState }, { "custom_parameters", DisabledRequiredState }, { "custom_instrumentation_editor", DisabledRequiredState }, { "dotnet_unknown_setting", DisabledRequiredState } }; var expectedMissing = new List <string> { "dotnet_unknown_setting" }; var missingRequiredPolicies = SecurityPoliciesConfiguration.GetMissingRequiredPolicies(serverPoliciesAllRequiredKnown); Assert.AreEqual(expectedMissing, missingRequiredPolicies); }