Exemple #1
0
        public void JoinListOfInt()
        {
            List <int> numbers = List354();

            Assert.AreEqual("3, 5, 4",
                            DataUtil.Join(numbers, ", "));
        }
        public void ExitToLevelCurrently()
        {
            LevelSelectModel model = new LevelSelectModel();

            Configure(model);
            model.Setup();
            string message = "menus [" + DataUtil.Join(model.menus, ", ") + "]"
                             + " levelsPerItem [" + DataUtil.Join(model.levelsPerItem, ", ") + "]";

            Assert.AreEqual(true, model.Select(0));
            Assert.AreEqual(true, model.Select(5));
            Assert.AreEqual(2, model.menuIndex);
            Assert.AreEqual(100, model.context);
            Assert.AreEqual(true, model.Select(7));
            Assert.AreEqual(107, model.levelSelected);
            model.Exit();
            Assert.AreEqual(2, model.menuIndex);
            Assert.AreEqual(100, model.context, message);
            Assert.AreEqual(true, model.Select(7));
            Assert.AreEqual(107, model.levelSelected);
            Assert.AreEqual(3, model.menuIndex);
            model.levelCurrently = 125;
            model.Exit();
            Assert.AreEqual(2, model.menuIndex);
            Assert.AreEqual(120, model.context, message);
            model.Exit();
            Assert.AreEqual(1, model.menuIndex);
            Assert.AreEqual(0, model.context);
            model.Exit();
            Assert.AreEqual(0, model.menuIndex);
            Assert.AreEqual(0, model.context);
        }
Exemple #3
0
        public void ClearListAtMiddle()
        {
            List <int> numbers = List354();

            DataUtil.Clear(numbers, 1);
            Assert.AreEqual(1, DataUtil.Length(numbers));
            Assert.AreEqual("3",
                            DataUtil.Join(numbers, ", "));
        }
Exemple #4
0
        public void ClearListAtEnd()
        {
            List <int> numbers = List354();

            DataUtil.Clear(numbers, 2);
            Assert.AreEqual(2, DataUtil.Length(numbers));
            Assert.AreEqual("3, 5",
                            DataUtil.Join(numbers, ", "));
        }