Skip to content
This repository was archived by the owner on Feb 25, 2024. It is now read-only.

Commit 5817d1a

Browse files
committed
Added Utils tests
1 parent d40e304 commit 5817d1a

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# VBAN-API [![Build Status](https://travis-ci.com/burdoto/VBAN-API.svg?branch=master)](https://travis-ci.com/burdoto/VBAN-API) [![Maven Central Release](https://maven-badges.herokuapp.com/maven-central/de.kaleidox/vban-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.kaleidox/vban-api) [![Development Release](https://jitpack.io/v/burdoto/VBAN-API.svg)](https://jitpack.io/#burdoto/VBAN-API)
1+
# VBAN-API [![Build Status](https://travis-ci.com/burdoto/VBAN-API.svg?branch=master)](https://travis-ci.com/burdoto/VBAN-API) [![Javadocs](http://javadoc.io/badge/de.kaleidox/vban-api.svg)](http://javadoc.io/doc/de.kaleidox/vban-api) [![Maven Central Release](https://maven-badges.herokuapp.com/maven-central/de.kaleidox/vban-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.kaleidox/vban-api) [![Development Release](https://jitpack.io/v/burdoto/VBAN-API.svg)](https://jitpack.io/#burdoto/VBAN-API)
22
API for the known VB-Audio VBAN Network interface
33

44

src/main/java/de/kaleidox/vban/Util.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public static byte[] createByteArray(Object data) {
8585
* and if not, throws an {@link IllegalArgumentException}.
8686
*
8787
* @param check The int to check range of.
88-
* @param from The minimum value.
89-
* @param to The maximum value.
88+
* @param from The minimum value.
89+
* @param to The maximum value.
9090
* @throws IllegalArgumentException If the integer is out of bounds.
9191
*/
9292
public static void checkRange(int check, int from, int to) throws IllegalArgumentException {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package de.kaleidox.test.vban;
2+
3+
import org.junit.Test;
4+
5+
import static de.kaleidox.vban.Util.checkRange;
6+
7+
public class UtilsTest {
8+
@Test
9+
public void testWithinBounds() {
10+
checkRange(5, 0, 10);
11+
checkRange(0, 0, 10);
12+
checkRange(10, 0, 10);
13+
}
14+
15+
@Test(expected = IllegalArgumentException.class)
16+
public void testOutOfLowerBounds() {
17+
checkRange(-1, 0, 255);
18+
}
19+
20+
@Test(expected = IllegalArgumentException.class)
21+
public void testOutOfUpperBounds() {
22+
checkRange(256, 0, 255);
23+
}
24+
}

0 commit comments

Comments
 (0)