public void Should_Throw_If_Value_Is_Null() { // Given var settings = new NpmSetSettings(); // When var result = Record.Exception(() => settings.WithValue(null)); // Then result.IsArgumentNullException("value"); }
public void Should_Throw_If_Settings_Are_Null() { // Given NpmSetSettings settings = null; // When var result = Record.Exception(() => settings.WithValue("foo")); // Then result.IsArgumentNullException("settings"); }
public void Should_Throw_If_Key_Is_WhiteSpace() { // Given var settings = new NpmSetSettings(); // When var result = Record.Exception(() => settings.ForKey(" ")); // Then result.IsArgumentNullException("key"); }
public void Should_Set_Key() { // Given var settings = new NpmSetSettings(); var key = "foo"; // When settings.ForKey(key); // Then settings.Key.ShouldBe(key); }
public void Should_Set_Value() { // Given var settings = new NpmSetSettings(); var value = "foo"; // When settings.WithValue(value); // Then settings.Value.ShouldBe(value); }
public static void NpmSet(this ICakeContext context, NpmSetSettings settings) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (settings == null) { throw new ArgumentNullException(nameof(settings)); } AddinInformation.LogVersionInformation(context.Log); var tool = new NpmSetTool(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log); tool.Set(settings); }
public static void NpmSet(this ICakeContext context, Action <NpmSetSettings> configurator) { if (context == null) { throw new ArgumentNullException(nameof(context)); } if (configurator == null) { throw new ArgumentNullException(nameof(configurator)); } var settings = new NpmSetSettings(); configurator(settings); context.NpmSet(settings); }