public InListExpression(String[] values, MatchQuotas matchQuota = MatchQuotas.None) { values.VerifyThatArrayIsNotNullAndNotEmpty("Parameter 'values' is null or empty."); this.values = new ValueRecord[values.Length]; for (Int32 index = 0; index < values.Length; index++) { this.values[index].Value = values[index]; } this.matchQuota = matchQuota; if (matchQuota == MatchQuotas.FirstMatchOfEachTermInList) { this.valuesMatched = new Boolean[values.Length]; } }
public void VerifyThatArrayIsNotNullAndNotEmpty_ArrayIsEmptyWithCustomMessage_ThrowsExpectedException() { String[] array = new String[0]; Action action = () => array.VerifyThatArrayIsNotNullAndNotEmpty("Custom exception message."); action.ShouldThrow<Exception>().WithMessage("Custom exception message."); }
public void VerifyThatArrayIsNotNullAndNotEmpty_ArrayIsNotEmpty_ExceptionNotThrown() { String[] array = new String[1]; Action action = () => array.VerifyThatArrayIsNotNullAndNotEmpty(); action.ShouldNotThrow(); }
public void VerifyThatArrayIsNotNullAndNotEmpty_ArrayIsEmpty_ThrowsExpectedException() { String[] array = new String[0]; Action action = () => array.VerifyThatArrayIsNotNullAndNotEmpty(); action.ShouldThrow<Exception>().WithMessage("Array is null or empty."); }