public void should_configure_whitelist_for_sanitizer() { // given var whiteListSettings = new HtmlWhiteListSettings() { AllowedElements = new List <string> { "StarWarsMarquee" }, AllowedAttributes = new List <string> { "cheesecake" } }; var whiteListProviderMock = Substitute.For <IHtmlWhiteListProvider>(); whiteListProviderMock .Deserialize() .Returns(whiteListSettings); HtmlSanitizerFactory factory = CreateFactory(null, whiteListProviderMock); // when IHtmlSanitizer sanitizer = factory.CreateHtmlSanitizer(); // then sanitizer.ShouldNotBeNull(); sanitizer.AllowDataAttributes.ShouldNotBeNull(); sanitizer.AllowedSchemes.ShouldContain("http"); sanitizer.AllowedSchemes.ShouldContain("https"); sanitizer.AllowedSchemes.ShouldContain("mailto"); sanitizer.AllowedTags.ShouldContain("StarWarsMarquee"); sanitizer.AllowedAttributes.ShouldContain("cheesecake"); }