protected AbstractCoreTests() { MockLogger = new Mock<ILogger>(); MockOptions = new Mock<SettingsWrapper>(); MockFrameworkReporter = new Mock<ITestFrameworkReporter>(); TestEnvironment = new TestEnvironment(MockOptions.Object, MockLogger.Object); TestDataCreator = new TestDataCreator(TestEnvironment); }
protected AbstractCoreTests() { MockLogger = new Mock <ILogger>(); MockOptions = new Mock <SettingsWrapper>(); MockFrameworkReporter = new Mock <ITestFrameworkReporter>(); TestEnvironment = new TestEnvironment(MockOptions.Object, MockLogger.Object); TestDataCreator = new TestDataCreator(TestEnvironment); }
public void GetTestsFromExecutable_WithoutPathExtension_ProducesWarning() { string baseDir = TestDataCreator.PreparePathExtensionTest(); try { string targetExe = TestDataCreator.GetPathExtensionExecutable(baseDir); var discoverer = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options); IList <TestCase> testCases = discoverer.GetTestsFromExecutable(targetExe); testCases.Count.Should().Be(0); MockLogger.Verify(l => l.LogError(It.Is <string>(s => s.StartsWith("Could not list test cases of executable")))); } finally { Utils.DeleteDirectory(baseDir).Should().BeTrue(); } }
public void GetTestsFromExecutable_WithPathExtension_FindsTestsWithLocation() { string baseDir = TestDataCreator.PreparePathExtensionTest(); try { string targetExe = Path.Combine(baseDir, "exe", Path.GetFileName(TestResources.DllTests_ReleaseX86)); MockOptions.Setup(o => o.PathExtension).Returns(SettingsWrapper.ExecutableDirPlaceholder + @"\..\dll"); var discoverer = new GoogleTestDiscoverer(TestEnvironment.Logger, TestEnvironment.Options); IList <TestCase> testCases = discoverer.GetTestsFromExecutable(targetExe); testCases.Count.Should().Be(TestResources.NrOfDllTests); } finally { Utils.DeleteDirectory(baseDir).Should().BeTrue(); } }