Example #1
0
            public async void Should_Throw_For_Null_Context_For_Working_Directory()
            {
                // Given
                var settings = new MkDocsServeAsyncSettings();

                // When
                var result = await(Record.ExceptionAsync(() => MkDocsAliases.MkDocsServeAsync(null, settings)) ?? Task.FromResult <Exception>(null));

                // Then
                Assert.IsType <ArgumentNullException>(result);
                Assert.Equal("context", ((ArgumentNullException)result).ParamName);
            }
Example #2
0
            public async void Should_Not_Throw_For_Defined_Settings_For_Working_Directory()
            {
                // Given
                var context  = new MkDocsContextFixture();
                var settings = new MkDocsServeAsyncSettings();

                // When
                var result = await(Record.ExceptionAsync(() => context.MkDocsServeAsync(settings)) ?? Task.FromResult <Exception>(null));

                // Then
                Assert.Null(result);
            }
        protected BaseMkDocsServeAsyncFixture()
        {
            Settings      = new MkDocsServeAsyncSettings();
            ProcessRunner = new ToolFixtureProcessLongRunner(CreateResult);
            Environment   = FakeEnvironment.CreateUnixEnvironment();
            FileSystem    = new FakeFileSystem(Environment);
            Globber       = new Globber(FileSystem, Environment);
            Configuration = new FakeConfiguration();
            Tools         = new ToolLocator(Environment, new ToolRepository(Environment),
                                            new ToolResolutionStrategy(FileSystem, Environment, Globber, Configuration));

            // ReSharper disable once VirtualMemberCallInConstructor
            DefaultToolPath = GetDefaultToolPath(ToolFileName);
            FileSystem.CreateFile(DefaultToolPath);

            Settings.Token = new CancellationToken(true);
        }
Example #4
0
        public static Task MkDocsServeAsync(this ICakeContext context, DirectoryPath projectDirectory, MkDocsServeAsyncSettings settings)
        {
            var runner = MkDocsRunnerFactory.CreateServeAsyncRunner(context);

            return(runner.ServeAsync(projectDirectory, settings));
        }