private TestCase GetTestCase(Type typeOfClass, string testName, bool ignore = false) { var methodInfo = typeOfClass.GetMethod(testName); var testMethod = new TestMethod(methodInfo.Name, typeOfClass.FullName, Assembly.GetExecutingAssembly().FullName, isAsync: false); UnitTestElement element = new UnitTestElement(testMethod); element.Ignored = ignore; return(element.ToTestCase()); }
private void SetupNavigation(string source, UnitTestElement test, string className, string methodName) { var testNavigationData = new DummyNavigationData("DummyFileName.cs", 1, 10); this.testablePlatformServiceProvider.MockFileOperations.Setup(fo => fo.CreateNavigationSession(source)) .Returns(testNavigationData); int minLineNumber = testNavigationData.MinLineNumber; string fileName = testNavigationData.FileName; this.testablePlatformServiceProvider.MockFileOperations.Setup( fo => fo.GetNavigationData( testNavigationData, It.IsAny <string>(), It.IsAny <string>(), out minLineNumber, out fileName)); var testCase1 = test.ToTestCase(); this.SetTestCaseNavigationData(testCase1, testNavigationData.FileName, testNavigationData.MinLineNumber); }
public void RecordStart(UnitTestElement test) { this.recorder.RecordStart(test.ToTestCase()); }
public void RecordEnd(UnitTestElement test, UnitTestOutcome outcome) { this.recorder.RecordEnd(test.ToTestCase(), UnitTestOutcomeHelper.ToTestOutcome(outcome, MSTestSettings.CurrentSettings)); }