Example #1
0
            public void Should_Throw_If_Services_Reference_Is_Null()
            {
                // Given
                ICakeServices services = null;

                // When
                var result = Record.Exception(() => services.UsePackageInstaller <DummyPackageInstaller>());

                // Then
                AssertEx.IsArgumentNullException(result, "services");
            }
Example #2
0
        public void Configure(ICakeServices services)
        {
            services.UseContext <Context>();
            services.UseLifetime <Lifetime>();
            services.UseTaskLifetime <TaskLifetime>();
            services.UseWorkingDirectory(".");
            services.UsePackageInstaller <NuGetPackageInstaller>();

            // Workaround, cannot use services.UseModule<NuGetModule>(), because there is no default constructor
            var nuGetModule = new NuGetModule(new CakeConfiguration(new Dictionary <string, string>()));

            nuGetModule.Register(services);
        }