public PlaceholderReplacer(Func <string> getSolutionDir, Func <IGoogleTestAdapterSettings> getSettings, HelperFilesCache helperFilesCache, ILogger logger)
 {
     _getSolutionDir   = getSolutionDir;
     _getSettings      = getSettings;
     _helperFilesCache = helperFilesCache;
     _logger           = logger;
 }
Beispiel #2
0
        public void GetReplacementsMap_NoFile_EmptyDictionary()
        {
            string executable    = TestResources.Tests_DebugX86;
            var    extraSettings = HelperFilesCache.GetHelperFile(executable);

            extraSettings.AsFileInfo().Should().NotExist();

            var cache = new HelperFilesCache(MockLogger.Object);
            var map   = cache.GetReplacementsMap(executable);

            map.Should().BeEmpty();
        }
Beispiel #3
0
        private void DoTest(string content, Action <IDictionary <string, string> > assertions, string executable = TestResources.Tests_DebugX86)
        {
            var extraSettings = HelperFilesCache.GetHelperFile(executable);

            try
            {
                extraSettings.AsFileInfo().Should().NotExist();
                File.WriteAllText(extraSettings, content);

                var cache = new HelperFilesCache(MockLogger.Object);
                var map   = cache.GetReplacementsMap(executable);
                assertions(map);
            }
            finally
            {
                File.Delete(extraSettings);
            }
        }