package net.franckbenault.bdd.calculator;


import org.junit.Test;

import com.tngtech.jgiven.Stage;
import com.tngtech.jgiven.junit.SimpleScenarioTest;
import net.franckbenault.bdd.calculator.DateCalculatorTest.TestSteps;

public class DateCalculatorTest extends SimpleScenarioTest<TestSteps> {

	@Test
	public void test() {
	}

	
	public static class TestSteps extends Stage<TestSteps> {
		
		private int i=0;
		
	}
}

@@ -48,56 +48,298 @@
 ort 
-org.junit.Test;%0A%0Aimport com.tngtech.jgiven.Stage
+java.text.DateFormat;%0Aimport java.text.ParseException;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Date;%0Aimport java.util.Locale;%0A%0Aimport org.junit.Test;%0A%0Aimport com.tngtech.jgiven.Stage;%0Aimport com.tngtech.jgiven.annotation.Format;%0Aimport com.tngtech.jgiven.format.BooleanFormatter
 ;%0Aim
@@ -388,16 +388,17 @@
 ioTest;%0A
+%0A
 import n
@@ -557,102 +557,1207 @@
 oid 
-test() %7B%0A%09%7D%0A%0A%09%0A%09public static class TestSteps extends Stage%3CTestSteps%3E %7B%0A%09%09%0A%09%09private int i=0;
+determine_past_date_test() throws ParseException %7B%0A%09    given().today_is_$(%222011-01-20%22);%0A%09    when().$_ask_if_$_is_in_the_past(%22I%22,%22Jan 19, 2011%22);%0A%09%09then().the_result_should_be_$(true);%0A%0A%09%7D%0A%09%0A%0A%09@Test%0A%09public void determine_non_past_date_test() throws ParseException %7B%0A%09    given().today_is_$(%222011-01-20%22);%0A%09    when().$_ask_if_$_is_in_the_past(%22I%22,%22Jan 22, 2011%22);%0A%09%09then().the_result_should_be_$(false);%0A%0A%09%7D%0A%0A%09%0A%09public static class TestSteps extends Stage%3CTestSteps%3E %7B%0A%09%09%0A%09%09private DateCalculator calculator;%0A%09%09private Date checkedDate;%0A%0A%09%09public void today_is_$(String currentDateInputString) throws ParseException %7B%0A%09%09%09SimpleDateFormat format = new SimpleDateFormat(%22yyyy-MM-dd%22);%0A%09%09%09Date date = format.parse(currentDateInputString);%0A%09%09%09calculator = new DateCalculator(date);%0A%09%09%7D%0A%0A%09%09public void the_result_should_be_$(%0A%09%09%09%09@Format( value = BooleanFormatter.class, args = %7B %22yes%22, %22no%22 %7D ) boolean yesNo) %7B%0A%09%09%09%09%0A%09%09%09calculator.isDateInThePast(checkedDate);%0A%09%09%7D%0A%0A%09%09public void $_ask_if_$_is_in_the_past(String user, String checkedDateString) throws ParseException %7B%0A%09%09%09DateFormat format = new SimpleDateFormat(%22MMM dd, YYYY%22, Locale.ENGLISH);%0A%09%09%09checkedDate = format.parse(checkedDateString);%0A%09%09%7D
 %0A%09%09%0A

implement tests with jgiven