public void Should_Throw_If_Package_Is_Null() { // Given var settings = new NpmRebuildSettings(); // When var result = Record.Exception(() => settings.AddScopedPackage(null, "@bar")); // Then result.IsArgumentNullException("packageName"); }
public void Should_Throw_If_Settings_Are_Null() { // Given NpmRebuildSettings settings = null; // When var result = Record.Exception(() => settings.AddScopedPackage("foo", "@bar")); // Then result.IsArgumentNullException("settings"); }
public void Should_Throw_If_Scope_Does_Not_Start_With_At() { // Given var settings = new NpmRebuildSettings(); // When var result = Record.Exception(() => settings.AddScopedPackage("foo", "bar")); // Then result.IsArgumentException("scope"); }
public void Should_Add_Package_If_Scope_Is_WhiteSpace() { // Given var settings = new NpmRebuildSettings(); var packageName = "foo"; var scope = " "; // When settings.AddScopedPackage(packageName, scope); // Then settings.Packages.Count.ShouldBe(1); settings.Packages.ShouldContain(packageName); }