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); }
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); }
public static Task MkDocsServeAsync(this ICakeContext context, DirectoryPath projectDirectory, MkDocsServeAsyncSettings settings) { var runner = MkDocsRunnerFactory.CreateServeAsyncRunner(context); return(runner.ServeAsync(projectDirectory, settings)); }