public void Should_Throw_If_Context_Is_Null() { // Given var declareParameter = new DeclareParameter(); // When var result = Record.Exception(() => declareParameter.AppendCommandLineArgument(null)); // Then Assert.IsArgumentNullException(result, "sb"); }
public void Should_Throw_If_Name_Is_Null_or_Empty() { // Given var declareParameter = new DeclareParameter(); // When...Then var result = Record.Exception(() => declareParameter.AppendCommandLineArgument(new StringBuilder())); // Then Assert.IsExceptionWithMessage <NullReferenceException>(result, "Name is required when using the DeclareParameter option."); }