Esempio n. 1
0
    public void Configure(ICakeServices services)
    {
        services.UseContext <Context>();
        services.UseLifetime <Lifetime>();
        services.UseWorkingDirectory("..");

        // from https://github.com/cake-build/cake/discussions/2931
        var module = new NuGetModule(new CakeConfiguration(new Dictionary <string, string>()));

        module.Register(services);

        services.UseTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.0.1"));
        services.UseTool(new Uri("nuget:?package=Microsoft.TestPlatform&version=16.8.0"));
        services.UseTool(new Uri("nuget:?package=NUnitTestAdapter&version=2.3.0"));
        services.UseTool(new Uri("nuget:?package=NuGet.CommandLine&version=5.8.0"));
    }
Esempio n. 2
0
            public void Should_Throw_If_Services_Reference_Is_Null()
            {
                // Given
                ICakeServices services = null;

                // When
                var result = Record.Exception(() => services.UseTool(new Uri("nuget:?package=Foo")));

                // Then
                AssertEx.IsArgumentNullException(result, "services");
            }