public override void SetUp() { base.SetUp(); TheOptions = new SettingsWrapper(MockXmlOptions.Object) { RegexTraitParser = new RegexTraitParser(TestEnvironment) }; }
private string ToString(SettingsWrapper settings, PropertyInfo propertyInfo) { var value = propertyInfo.GetValue(settings); if (value is string) return $"{propertyInfo.Name}: '{value}'"; var pairs = value as IEnumerable<RegexTraitPair>; if (pairs != null) return $"{propertyInfo.Name}: {{{string.Join(", ", pairs)}}}"; return $"{propertyInfo.Name}: {value}"; }
public override void SetUp() { base.SetUp(); var containerMock = new Mock <IGoogleTestAdapterSettingsContainer>(); containerMock.Setup(c => c.SolutionSettings).Returns(MockXmlOptions.Object); containerMock.Setup(c => c.GetSettingsForExecutable(It.IsAny <string>())).Returns(MockXmlOptions.Object); TheOptions = new SettingsWrapper(containerMock.Object) { RegexTraitParser = new RegexTraitParser(TestEnvironment.Logger) }; }
private string ToString(SettingsWrapper settings, PropertyInfo propertyInfo) { var value = propertyInfo.GetValue(settings); if (value is string) { return($"{propertyInfo.Name}: '{value}'"); } var pairs = value as IEnumerable <RegexTraitPair>; if (pairs != null) { return($"{propertyInfo.Name}: {{{string.Join(", ", pairs)}}}"); } return($"{propertyInfo.Name}: {value}"); }
public VsTestFrameworkLogger(IMessageLogger logger, SettingsWrapper settings) { _logger = logger; _settings = settings; }
public SettingsPrinter(SettingsWrapper settings) { _settings = settings; }
internal static TestEnvironment CreateTestEnvironment(IRunSettings runSettings, IMessageLogger messageLogger) { var settingsProvider = runSettings.GetSettings(GoogleTestConstants.SettingsName) as RunSettingsProvider; RunSettings ourRunSettings = settingsProvider != null ? settingsProvider.Settings : new RunSettings(); var settingsWrapper = new SettingsWrapper(ourRunSettings); var loggerAdapter = new VsTestFrameworkLogger(messageLogger, settingsWrapper); TestEnvironment testEnvironment = new TestEnvironment(settingsWrapper, loggerAdapter); settingsWrapper.RegexTraitParser = new RegexTraitParser(testEnvironment); return testEnvironment; }
public TestEnvironment(SettingsWrapper options, ILogger logger) { Options = options; _logger = logger; }