public void Should_Set_Global() { // Given var settings = new NpmUpdateSettings(); // When settings.UpdateGlobalPackages(); // Then settings.Global.ShouldBe(true); }
public void Should_Throw_If_Settings_Are_Null() { // Given NpmUpdateSettings settings = null; // When var result = Record.Exception(() => settings.UpdateGlobalPackages()); // Then result.IsArgumentNullException("settings"); }
public static void NpmUpdate(this ICakeContext context, NpmUpdateSettings settings) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (settings == null) { throw new ArgumentNullException(nameof(settings)); } AddinInformation.LogVersionInformation(context.Log); var tool = new NpmUpdateTool(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log); tool.Update(settings); }
public static void NpmUpdate(this ICakeContext context, Action <NpmUpdateSettings> configurator) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (configurator == null) { throw new ArgumentNullException(nameof(configurator)); } var settings = new NpmUpdateSettings(); configurator(settings); context.NpmUpdate(settings); }