package com.accenture.multibank.generator;

import org.junit.Assert;
import org.junit.Test;

public class TestSimpleAccountNumberGenerator {

	private AccountNumberGenerator generator;

	@Test
	public void generateNumber10Times() {
		int startAccNr = 0, timesGenerated = 10, accNum = startAccNr;
		generator = new SimpleAccountNumberGenerator(startAccNr);
		for (int i = timesGenerated; i > 0;--i)
			accNum = generator.generateAccountNumber();

		Assert.assertEquals(startAccNr+timesGenerated, accNum);
	}

	@Test
	public void generateNumber10TimesWithNegativeStartValue() {
		int startAccNr = -10, timesGenerated = 10, accNum = startAccNr;
		generator = new SimpleAccountNumberGenerator(startAccNr);
		for (int i = timesGenerated; i > 0;--i)
			accNum = generator.generateAccountNumber();

		Assert.assertEquals(startAccNr+timesGenerated, accNum);
	}

    @SuppressWarnings("null")
	@Test(expected = NullPointerException.class)
    public void generateNumberWithNullStartValue() {
		Integer startAccNr = null, timesGenerated = 10, accNum = startAccNr;
		generator = new SimpleAccountNumberGenerator(startAccNr);
		Integer expected = generator.generateAccountNumber();
	}
}

@@ -877,17 +877,20 @@
 %22null%22)%0A
-%09
+    
 @Test(ex
@@ -983,79 +983,8 @@
 ) %7B%0A
-%09%09Integer startAccNr = null, timesGenerated = 10, accNum = startAccNr;%0A
 %09%09ge
@@ -1030,42 +1030,17 @@
 tor(
-startAccNr);%0A%09%09Integer expected = 
+null);%0A%09%09
 gene

remove unused variables