public void SustainsysSaml2Section_Attributes_EmptyIfNotConfigured() { var subject = new SustainsysSaml2Section(); subject.AllowChange = true; subject.Metadata = new MetadataElement(); subject.AttributeConsumingServices.Should().BeEmpty(); }
private static void AddIdP(SustainsysSaml2Section section, IdentityProviderElement newProvider) { var isReadonly = typeof(ConfigurationElementCollection).GetField("bReadOnly", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); isReadonly.SetValue(section.IdentityProviders, false); var providers = typeof(ConfigurationElementCollection).GetMethod("BaseAdd", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, new[] { typeof(ConfigurationElement) }, null); providers.Invoke(section.IdentityProviders, new[] { newProvider }); }