public void When_reading_memory_stream_should_load_list() { IList <string> ignoreList = IgnoreListLoader.LoadIgnoreList(Builder.Stream); Assert.AreEqual("Line1", ignoreList[0]); Assert.AreEqual("Line2", ignoreList[1]); }
public Check(string referencePath, string newPath, string htmlPath, string xmlPath, string ignorePath, bool verbose) { using (AssemblyLoader assemblyLoader = new AssemblyLoader()) { _referenceAssembly = assemblyLoader.ReflectionOnlyLoad(referencePath); _newAssembly = assemblyLoader.ReflectionOnlyLoad(newPath); } _htmlStream = GetWriteStream(htmlPath); _xmlStream = GetWriteStream(xmlPath); _ignoreList = IgnoreListLoader.LoadIgnoreList(GetReadStream(ignorePath)); _log = verbose ? (Action <string>)(System.Console.WriteLine) : s => { }; }
private IEnumerable <ApiTestData> GetResults() { using (AssemblyLoader assemblyLoader = new AssemblyLoader()) { object[] customAttributes = GetType().GetCustomAttributes(typeof(ApiTestAttribute), true); if (customAttributes.Length == 0) { throw new Exception(string.Format("The test class should define the {0} at least once", typeof(ApiTestAttribute))); } foreach (object customAttribute in customAttributes) { ApiTestAttribute apiTestAttribute = (ApiTestAttribute)customAttribute; ApiComparer apiComparer = ApiComparer.CreateInstance(assemblyLoader.ReflectionOnlyLoad(apiTestAttribute.ReferenceVersionPath), assemblyLoader.ReflectionOnlyLoad(apiTestAttribute.NewVersionPath)) .Build(); apiComparer.CheckApi(); IList <string> ignoreList = IgnoreListLoader.LoadIgnoreList(GetReadStream(apiTestAttribute.IgnoreListPath)); yield return(new ApiTestData(apiComparer.ComparerResult, apiTestAttribute.Category, ignoreList, apiTestAttribute.Explicit)); } } }