public void Game_ComplexFormula_True_GuessFalse() { BivalenceWorld world = new BivalenceWorld(); List <string> sentences = new List <string> { "(Tet(a)∨Cube(a)) → (Small(a) ∧ LeftOf(a,b))", }; List <WorldObject> worldObjects = new List <WorldObject> { new WorldObject(new List <string> { "a" }, new List <string> { BivalenceWorldDataFields.DODEC, BivalenceWorldDataFields.LARGE }, new List <object> { 1, 3 }), new WorldObject(new List <string> { "b" }, new List <string> { BivalenceWorldDataFields.CUBE, BivalenceWorldDataFields.LARGE }, new List <object> { 3, 3 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); Game game = new Game(sentences[0], world, false); var move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is Question); var question = move as Question; Assert.IsTrue(question.PossibleAnswers.Count == 2); question.SetAnswers(question.PossibleAnswers[0]); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is EndMessage); var end = move as EndMessage; Assert.IsFalse(end.GuessWasRight); }
public void Game_Implication_True_GuessTrue_RightSelection() { BivalenceWorld world = new BivalenceWorld(); List <string> sentences = new List <string> { "Tet(a) \u2192 Tet(c)", }; List <WorldObject> worldObjects = new List <WorldObject> { new WorldObject(new List <string> { "a" }, new List <string> { BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List <object> { 1, 3 }), new WorldObject(new List <string> { "c" }, new List <string> { BivalenceWorldDataFields.TET, BivalenceWorldDataFields.LARGE }, new List <object> { 3, 3 }) }; WorldParameter parameter = new WorldParameter(worldObjects, sentences); var result = world.Check(parameter); Game game = new Game(sentences[0], world, true); var move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is Question); var question = move as Question; Assert.IsTrue(question.PossibleAnswers.Count == 2); question.SetAnswers(question.PossibleAnswers[1]); move = game.Play(); Assert.IsTrue(move is InfoMessage); move = game.Play(); Assert.IsTrue(move is EndMessage); var end = move as EndMessage; Assert.IsTrue(end.GuessWasRight); }