Example #1
0
        public void TestGetCurrentAreaWhenCurrentNotSet()
        {
            var area = AreasForShowAndTests.GetAreaForShow();

            game = new Game(new[] { area });

            Assert.AreEqual(game.AreaBlock.GetCurrentArea(), area);
        }
Example #2
0
        public void TestTryChangeArea(int index)
        {
            var list = new List <Area>
            {
                AreasForShowAndTests.GetAreaForShow(),
                AreasForShowAndTests.GetAreaForTests()
            };

            game = new Game(list.ToArray(), 0);

            var isSuccess = game.AreaBlock.TryChangeArea(index);

            if (index < 0 || index >= 2)
            {
                Assert.IsFalse(isSuccess);
                Assert.AreEqual(list[0], game.AreaBlock.GetCurrentArea());
            }
            else
            {
                Assert.IsTrue(isSuccess);
                Assert.AreEqual(list[index], game.AreaBlock.GetCurrentArea());
            }
        }
Example #3
0
 public void Setup()
 {
     area = AreasForShowAndTests.GetAreaForTests();
 }