예제 #1
0
        public override void SetUp()
        {
            base.SetUp();

            TheOptions = new SettingsWrapper(MockXmlOptions.Object)
            {
                RegexTraitParser = new RegexTraitParser(TestEnvironment)
            };
        }
        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}";
        }
예제 #4
0
        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)
            };
        }
예제 #5
0
        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;
 }
예제 #7
0
 public SettingsPrinter(SettingsWrapper settings)
 {
     _settings = settings;
 }
예제 #8
0
 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;
 }