public void Setup()
        {
            fileSystem        = new TestFileSystem();
            configFileLocator = new NamedConfigFileLocator("my-config.yaml");
            repoPath          = DefaultRepoPath;
            workingPath       = DefaultWorkingPath;

            ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute <TestAttribute>();
        }
Пример #2
0
        public void Setup()
        {
            fileSystem = new TestFileSystem();
            log        = new NullLog();

            options = Options.Create(new Arguments {
                ConfigFile = "my-config.yaml"
            });
            configFileLocator = new NamedConfigFileLocator(fileSystem, log, options);
            repoPath          = DefaultRepoPath;
            workingPath       = DefaultWorkingPath;
            stepFactory       = new ConfigInitStepFactory();

            ShouldlyConfiguration.ShouldMatchApprovedDefaults.LocateTestMethodUsingAttribute <TestAttribute>();
        }
Пример #3
0
        public void NoWarnOnCustomYmlFileOutsideRepoPath()
        {
            SetupConfigFileContent(string.Empty, path: @"c:\\Unrelated\\path");

            var stringLogger = string.Empty;

            void Action(string info) => stringLogger = info;

            var logAppender = new TestLogAppender(Action);

            log = new Log(logAppender);

            configFileLocator = new NamedConfigFileLocator(fileSystem, log, options);
            var gitPreparer = new GitPreparer(log, new TestEnvironment(), Options.Create(new Arguments {
                TargetPath = repoPath
            }));
            var configInitWizard      = new ConfigInitWizard(new ConsoleAdapter(), stepFactory);
            var configurationProvider = new ConfigProvider(fileSystem, log, configFileLocator, gitPreparer, configInitWizard);

            configurationProvider.Provide(repoPath);
            stringLogger.Length.ShouldBe(0);
        }