public void Should_Set_Production() { // Given var settings = new NpmCiSettings(); // When settings.ForProduction(); // Then settings.Production.ShouldBe(true); }
public void Should_Throw_If_Settings_Are_Null() { // Given NpmCiSettings settings = null; // When var result = Record.Exception(() => settings.ForProduction()); // Then result.IsArgumentNullException("settings"); }
public void Should_Set_Registry() { // Given var settings = new NpmCiSettings(); var registry = new Uri("https://myregistry.com"); // When var result = settings.FromRegistry(registry); // Then result.Registry.ShouldBe(registry); }
public void Should_Throw_If_Registry_Is_Null() { // Given var settings = new NpmCiSettings(); Uri registry = null; // When var result = Record.Exception(() => settings.FromRegistry(registry)); // Then result.IsArgumentNullException("registry"); }
public void Should_Throw_If_Settings_Are_Null() { // Given NpmCiSettings settings = null; var registry = new Uri("https://myregistry.com"); // When var result = Record.Exception(() => settings.FromRegistry(registry)); // Then result.IsArgumentNullException("settings"); }
public static void NpmCi(this ICakeContext context, NpmCiSettings settings) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (settings == null) { throw new ArgumentNullException(nameof(settings)); } AddinInformation.LogVersionInformation(context.Log); var ciTool = new NpmCiTool(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log); ciTool.Install(settings); }
public static void NpmCi(this ICakeContext context, Action <NpmCiSettings> configurator) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (configurator == null) { throw new ArgumentNullException(nameof(configurator)); } var settings = new NpmCiSettings(); configurator(settings); context.NpmCi(settings); }