From 6ba8da452dd994561b580ba3b7fc566dff444bc5 Mon Sep 17 00:00:00 2001 From: Sara El Alaoui <saraelalaoui@SEA-2.local> Date: Mon, 14 Oct 2019 11:18:35 -0500 Subject: [PATCH] Adjusted formatting --- .../decomposition_and_conditionals/Game.java | 8 +++--- .../decomposition_and_conditionals/Nand.java | 1 - .../GameTest.java | 22 ++++++++-------- .../NandTest.java | 26 +++++++++---------- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/main/java/edu/unl/cse/soft160/decomposition_and_conditionals/Game.java b/src/main/java/edu/unl/cse/soft160/decomposition_and_conditionals/Game.java index bec60b9..8668d37 100755 --- a/src/main/java/edu/unl/cse/soft160/decomposition_and_conditionals/Game.java +++ b/src/main/java/edu/unl/cse/soft160/decomposition_and_conditionals/Game.java @@ -4,12 +4,14 @@ public class Game { private static enum Direction { UP, DOWN, RIGHT, LEFT, } + private static enum Result { WIN, NOT_ALLOWED, NEW_POSITION, } - static final int x_win=7; - static final int y_win=6; - + + static final int x_win = 7; + static final int y_win = 6; + public static void main(String... arguments) { // [write code here] } diff --git a/src/main/java/edu/unl/cse/soft160/decomposition_and_conditionals/Nand.java b/src/main/java/edu/unl/cse/soft160/decomposition_and_conditionals/Nand.java index e07ed75..8322764 100755 --- a/src/main/java/edu/unl/cse/soft160/decomposition_and_conditionals/Nand.java +++ b/src/main/java/edu/unl/cse/soft160/decomposition_and_conditionals/Nand.java @@ -1,6 +1,5 @@ package edu.unl.cse.soft160.decomposition_and_conditionals; - public class Nand { private static enum TruthValue { TRUE, FALSE, UNKNOWN, diff --git a/src/test/java/edu/unl/cse/soft160/decomposition_and_conditionals/GameTest.java b/src/test/java/edu/unl/cse/soft160/decomposition_and_conditionals/GameTest.java index 9209b71..03df098 100644 --- a/src/test/java/edu/unl/cse/soft160/decomposition_and_conditionals/GameTest.java +++ b/src/test/java/edu/unl/cse/soft160/decomposition_and_conditionals/GameTest.java @@ -26,7 +26,7 @@ public class GameTest { System.setOut(out); return collector.toString(); } - + @Test public void testUpNotallowed() { assertEquals( @@ -34,7 +34,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: NOT_ALLOWED"), runMain("6", "7", "Up", "7")); } - + @Test public void testUpWin() { assertEquals( @@ -42,7 +42,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: WIN"), runMain("7", "3", "Up", "3")); } - + @Test public void testUpNewPosition() { assertEquals( @@ -50,7 +50,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: NEW_POSITION"), runMain("6", "1", "Up", "7")); } - + @Test public void testDownNotallowed() { assertEquals( @@ -58,7 +58,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: NOT_ALLOWED"), runMain("6", "3", "Down", "7")); } - + @Test public void testDownWin() { assertEquals( @@ -66,7 +66,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: WIN"), runMain("7", "8", "Down", "2")); } - + @Test public void testDownNewPosition() { assertEquals( @@ -82,7 +82,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: NOT_ALLOWED"), runMain("6", "7", "Left", "9")); } - + @Test public void testLeftWin() { assertEquals( @@ -90,7 +90,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: WIN"), runMain("9", "6", "Left", "2")); } - + @Test public void testLeftNewPosition() { assertEquals( @@ -98,7 +98,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: NEW_POSITION"), runMain("6", "7", "Left", "3")); } - + @Test public void testRightNotallowed() { assertEquals( @@ -106,7 +106,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: NOT_ALLOWED"), runMain("6", "7", "Right", "7")); } - + @Test public void testRightWin() { assertEquals( @@ -114,7 +114,7 @@ public class GameTest { + "Enter the number of the steps to move: Move result: WIN"), runMain("6", "6", "Right", "1")); } - + @Test public void testRightNewPosition() { assertEquals( diff --git a/src/test/java/edu/unl/cse/soft160/decomposition_and_conditionals/NandTest.java b/src/test/java/edu/unl/cse/soft160/decomposition_and_conditionals/NandTest.java index 7afcfbf..156eebc 100644 --- a/src/test/java/edu/unl/cse/soft160/decomposition_and_conditionals/NandTest.java +++ b/src/test/java/edu/unl/cse/soft160/decomposition_and_conditionals/NandTest.java @@ -26,29 +26,29 @@ public class NandTest { System.setOut(out); return collector.toString(); } - - @Test + + @Test public void testTrueTrue() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: The NAND value of TRUE and TRUE is FALSE."), runMain("TRUE", "TRUE")); } - @Test + @Test public void testTrueFalse() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: The NAND value of TRUE and FALSE is TRUE."), runMain("TRUE", "FALSE")); } - @Test + @Test public void testFalseTrue() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: The NAND value of FALSE and TRUE is TRUE."), runMain("FALSE", "TRUE")); } - - @Test + + @Test public void testFalseFalse() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: The NAND value of FALSE and FALSE is TRUE."), @@ -62,42 +62,42 @@ public class NandTest { runMain("FALSE", "UNKNOWN")); } - @Test + @Test public void testUnknownFalse() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: The NAND value of UNKNOWN and FALSE is TRUE."), runMain("UNKNOWN", "FALSE")); } - @Test + @Test public void testUnknownUnknown() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: The NAND value of UNKNOWN and UNKNOWN is UNKNOWN."), runMain("UNKNOWN", "UNKNOWN")); } - @Test + @Test public void testTrueUnknown() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: The NAND value of TRUE and UNKNOWN is UNKNOWN."), runMain("TRUE", "UNKNOWN")); } - @Test + @Test public void testUnknownTrue() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: The NAND value of UNKNOWN and TRUE is UNKNOWN."), runMain("UNKNOWN", "TRUE")); } - @Test + @Test public void testExceptionInOp1() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: Truth value must be one of TRUE, FALSE, or UNKNOWN."), runMain("FOO", "TRUE")); } - - @Test + + @Test public void testExceptionInOp2() { assertEquals(assemble( "Enter truth value of operand 1: Enter truth value of operand 2: Truth value must be one of TRUE, FALSE, or UNKNOWN."), -- GitLab