public void TransformStringToStateReturnsStringForImplementedGameStateTypes() { var string1 = testStateTransformer.TransformStateToString(GameStateType.GameOver); var string2 = testStateTransformer.TransformStateToString(GameStateType.GamePaused); var string3 = testStateTransformer.TransformStateToString(GameStateType.GameRunning); var string4 = testStateTransformer.TransformStateToString(GameStateType.MainMenu); var state1 = testStateTransformer.TransformStringToState(string1); var state2 = testStateTransformer.TransformStringToState(string2); var state3 = testStateTransformer.TransformStringToState(string3); var state4 = testStateTransformer.TransformStringToState(string4); Assert.IsTrue( (state1 == GameStateType.GameOver && state2 == GameStateType.GamePaused && state3 == GameStateType.GameRunning && state4 == GameStateType.MainMenu)); }
public void StringToState() { Assert.True(StateTransformer.TransformStringToState("CHOOSE_LEVEL"). Equals(GameStateType.ChooseLevel)); Assert.True(StateTransformer.TransformStringToState("MAIN_MENU"). Equals(GameStateType.MainMenu)); Assert.True(StateTransformer.TransformStringToState("GAME_PAUSED"). Equals(GameStateType.GamePaused)); Assert.True(StateTransformer.TransformStringToState("GAME_RUNNING"). Equals(GameStateType.GameRunning)); }
public void TestNull() { Assert.Throws <ArgumentException>((() => StateTransformer.TransformStringToState("STOP"))); }
public void TestStringToState(StateTransformer.GameStateType type, string input) { Assert.AreEqual(type, StateTransformer.TransformStringToState(input)); }
public void TestTransformStringToStateGAME_RUNNING() { Assert.AreEqual(StateTransformer.TransformStringToState("GAME_RUNNING"), StateTransformer.GameStateType.GameRunning); }
public void TestTransformStringToStateGAME_PAUSED() { Assert.AreEqual(StateTransformer.TransformStringToState("GAME_PAUSED"), StateTransformer.GameStateType.GamePaused); }
public void TestTransformStringToStateGAME_MAINMENU() { Assert.AreEqual(StateTransformer.TransformStringToState("GAME_MAINMENU"), StateTransformer.GameStateType.MainMenu); }
public void StringToState3() { Assert.AreEqual(StateTransformer.TransformStringToState("GAME_MAIN"), GameStateType.MainMenu); }
public void TestStateTransformerThrows() { Assert.Throws <ArgumentException>(() => { StateTransformer.TransformStringToState("NOT_A_REAL_STATE"); }); // We cannot test if TransformStateToString throws, since there only are three possible cases for the enum, // and they are all covered. }
public void TestStateTransformerCorrect(GameStateType x, string y) { Assert.AreEqual(x, StateTransformer.TransformStringToState(y)); Assert.AreEqual(StateTransformer.TransformStateToString(x), y); }
public void TestStringToState2() { Assert.AreEqual(StateTransformer.TransformStringToState("MAIN_MENU"), GameStateType.MainMenu); }