public void Should_Add_PackageName_To_Packages() { // Given NpmPruneSettings settings = new NpmPruneSettings(); // When settings.AddPackage("test"); // Then settings.Packages.ShouldContain("test"); }
public void Should_Throw_If_PackageName_Is_Null_Or_Whitespace(string packageName) { // Given NpmPruneSettings settings = new NpmPruneSettings(); // When var result = Record.Exception(() => settings.AddPackage(packageName)); // Then result.IsArgumentNullException("packageName"); }
public void Should_Throw_If_Scope_Does_Not_Start_With_At_Symbol() { // Given NpmPruneSettings settings = new NpmPruneSettings(); // When var result = Record.Exception(() => settings.AddPackage("test", "badscope")); // Then result.IsArgumentException("scope"); }
public void Should_Throw_If_Settings_Are_Null() { // Given NpmPruneSettings settings = null; // When var result = Record.Exception(() => settings.AddPackage("test")); // Then result.IsArgumentNullException("settings"); }