public void TestBasicLogInjection() { var callback = new LogFeatherCallback(); var featherImpl = new LogInjectionRunner(this.assembly.MainModule, callback); var type = this.assembly.MainModule.GetType("FeatherSharp.Test.Resources.TestClass1"); featherImpl.ProcessType(type); CollectionAssert.AreEqual( Tuple.Create("FeatherSharp.Test.Resources.TestClass1", LogInjectionTypeInfo.Ok).Singleton(), callback.TypeInfos); CollectionAssert.AreEquivalent( new[] { Tuple.Create("FeatherSharp.Test.Resources.TestClass1::LogAllLevels", LogInjectionMethodInfo.Ok), Tuple.Create("FeatherSharp.Test.Resources.TestClass1::TestMethodAsync", LogInjectionMethodInfo.Ok), Tuple.Create("FeatherSharp.Test.Resources.TestClass1::DontFeatherBecauseIgnored", LogInjectionMethodInfo.Ignored), }, callback.MethodInfos); }
/////////////////////////////////////////////////////////////////////// void FeatherAndWriteAssembly() { var callback = new LogFeatherCallback(); var feather = new LogInjectionFeather(callback); feather.Execute(this.assembly.MainModule, OutputFileName); this.assembly.Write(ModifiedOutputFileName, new WriterParameters()); }