From 538110ffa88b19a27dd3406c29ccd1402e777b79 Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 5 Oct 2015 03:28:33 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20de=20la=20class=20de=20test?= =?UTF-8?q?=20Simulateur=20(Analyse=20des=20args)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/SimulateurTest.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/SimulateurTest.java b/test/SimulateurTest.java index 9ebf608..3b3f1d8 100644 --- a/test/SimulateurTest.java +++ b/test/SimulateurTest.java @@ -58,4 +58,32 @@ public void testMain() { } + @Test + public void testAnalyseArgumentsEmpty() throws ArgumentsException, Exception { + System.out.println("Test AnalyseArgumentsEmpty"); + String[] args = {}; + new Simulateur(args); + } + @Test(expected = ArgumentsException.class) + public void testAnalyseArgumentsAmplInvalide() throws ArgumentsException, Exception { + System.out.println("Test AnalyseArgumentsAmplInvalide"); + String[] args = ("-ampl 3 1").split(" "); + new Simulateur(args); + } + + @Test(expected = ArgumentsException.class) + public void testAnalyseArgumentsFormInvalide() throws ArgumentsException, Exception { + System.out.println("Test AnalyseArgumentsFormInvalide"); + String[] args = ("-form NRTE").split(" "); + new Simulateur(args); + } + + + @Test(expected = ArgumentsException.class) + public void testAnalyseArgumentsForm2Invalide() throws ArgumentsException, Exception { + System.out.println("Test AnalyseArgumentsForm2Invalide"); + String[] args = ("-form ").split(" "); + new Simulateur(args); + } + //TODO Check all other params }