async Task RunTest( Func <ITestCalls, Task> test, string resolveName, string expected) { await test(ServiceLocator.Current.GetInstance <ITestCalls>(resolveName)); var actual = string.Join("\r\n", TestTraceListener.Messages); TestTraceListener.Reset(); TestContext.WriteLine($"Actual: <{actual}>\nExpected: <{expected}>"); Assert.AreEqual(expected, actual); }
// Use ClassCleanup to run code after all tests in a class have run // [ClassCleanup()] // public static void MyClassCleanup() { } // // Use TestInitialize to run code before running each test // [TestInitialize()] // public void MyTestInitialize() { } // // Use TestCleanup to run code after each test has run // [TestCleanup()] // public void MyTestCleanup() { } // #endregion void RunTest( Action <ITestCalls> test, string resolveName, string expected) { var target = DIContainer.Root.Resolve <ITestCalls>(resolveName); test(target); var actual = string.Join("\r\n", TestTraceListener.Messages); TestTraceListener.Reset(); Assert.AreEqual(expected, actual); }