public void MatchesCodeInRangeTrue() { var start = GetHexBytes('0', 'A'); var end = GetHexBytes('8', '0'); var codespace = new CodespaceRange(start, end); var matches = codespace.Matches(GetHexBytes('5', 'A')); Assert.True(matches); }
public void MatchesCodeWrongLengthFalse() { var start = GetHexBytes('0', 'A'); var end = GetHexBytes('8', '0'); var codespace = new CodespaceRange(start, end); var matches = codespace.Matches(GetHexBytes('6', '9', '0', '1')); Assert.False(matches); }
public void MatchesCodeHigherThanEndFalse() { var start = GetHexBytes('0', 'A'); var end = GetHexBytes('8', '0'); var codespace = new CodespaceRange(start, end); var matches = codespace.Matches(GetHexBytes('9', '6')); Assert.False(matches); }
public void MatchesCodeIsNullThrows() { var start = GetHexBytes('0', 'A'); var end = GetHexBytes('8', '0'); var codespace = new CodespaceRange(start, end); Action action = () => codespace.Matches(null); Assert.Throws <ArgumentNullException>(action); }