Exemple #1
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();
        }
Exemple #2
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);
            }
        }