Exemplo n.º 1
0
        private static ConfigurationDiagnosticsOptions SetupOptions()
        {
            var options = new ConfigurationDiagnosticsOptions();

            options.BuildConnectionStringElementMatcher(builder => { builder.AddContainsMatcher("password"); });
            options.Obfuscator = new MatchedLengthAsteriskObfuscator();
            return(options);
        }
        public void BuildConnectionStringElementMatcherAssignsToConnectionStringElementMatcher()
        {
            var options = new ConfigurationDiagnosticsOptions();

            options.BuildConnectionStringElementMatcher(builder =>
            {
                builder.Add(new ContainsMatcher("def"));
            });

            options.ConnectionStringElementMatcher.ShouldNotBeNull();
            options.ConnectionStringElementMatcher.ShouldNotBeOfType <NullMatcher>();
        }