コード例 #1
0
 public void ToFilterRepositoryFromConfigurationManager(string sectionName, string expectedIncludes, string expectedExcludes)
 {
     var includes = string.IsNullOrEmpty(expectedIncludes) ? new List<string>() : expectedIncludes.Split(',').ToList();
     var excludes = string.IsNullOrEmpty(expectedExcludes) ? new List<string>() : expectedExcludes.Split(',').ToList();
     var repository = new AppConfigConfigurationManager().ToFilterRepository(sectionName);
     Assert.AreEqual(repository.Included.Count, includes.Count);
     foreach (var item in includes)
     {
         Assert.IsTrue(repository.Included.Contains(item));
     }
     Assert.AreEqual(repository.Excluded.Count, excludes.Count);
     foreach (var item in excludes)
     {
         Assert.IsTrue(repository.Excluded.Contains(item));
     }
 }
コード例 #2
0
 public void ToFilterFromConfigManager(string sectionName, string inputValue, bool expectedResult)
 {
     var filter = new AppConfigConfigurationManager().ToFilter(sectionName);
     var candidate = filter.IsExcluded(inputValue);
     Assert.That(candidate, Is.EqualTo(expectedResult));
 }