public void TestReadingConditionalWhiteList() { var analyzer = VaultSafeAnalyzerFactorySource.CreateDefaultAnalyzer(); ImmutableHashSet <string> expected = ImmutableHashSet.Create(new[] { typeof(KeyValuePair <,>).FullName, typeof(ImmutableArray <>).FullName, typeof(ImmutableArray <> .Enumerator).FullName, typeof(ImmutableList <>).FullName, typeof(ImmutableList <> .Enumerator).FullName, typeof(ImmutableDictionary <,>).FullName, typeof(ImmutableDictionary <,> .Enumerator).FullName, typeof(ImmutableSortedDictionary <,>).FullName, typeof(ImmutableSortedDictionary <,> .Enumerator).FullName, typeof(ImmutableHashSet <>).FullName, typeof(ImmutableHashSet <> .Enumerator).FullName, typeof(ImmutableSortedSet <>).FullName, typeof(ImmutableSortedSet <> .Enumerator).FullName, typeof(ImmutableStack <>).FullName, typeof(ImmutableStack <> .Enumerator).FullName, typeof(ImmutableQueue <>).FullName, typeof(ImmutableQueue <> .Enumerator).FullName, }); ImmutableHashSet <string> actual = analyzer.ConditionalGenericWhiteList; Assert.IsTrue(actual.IsSupersetOf(expected)); }
public void TestReadingTheList() { var analyzer = VaultSafeAnalyzerFactorySource.CreateDefaultAnalyzer(); string[] expected = { typeof(string).FullName, typeof(DateTime).FullName, typeof(Guid).FullName, typeof(TimeSpan).FullName }; var whiteList = analyzer.WhiteList; var fsExempt = analyzer.FieldScanExempt; Assert.IsTrue(whiteList.SetEquals(fsExempt)); Assert.IsTrue(whiteList.IsSupersetOf(expected)); }