Пример #1
0
        public ActionResult UpdateTiles(string key1, string key2, string key3)
        {
            Dictionary <string, object> dynamicDict = new Dictionary <string, object>();

            using (TilesLogic tLogic = new TilesLogic())
            {
                IUserData user = UserContext.CurrentUser;
                tLogic.Open();
                if (!String.IsNullOrEmpty(key1))
                {
                    DateTime today     = DateTime.Now;
                    DateTime begin     = today.AddDays(-today.Day + 1);
                    DateTime end       = today;
                    var      workHours = tLogic.GetWorkHoursByMonth(user.UserId, begin, end);
                    var      holidays  = tLogic.GetHolidayDays(today);
                    var      data      = FindWorkHours(workHours, holidays, begin, end);
                    dynamicDict[key1] = data;
                }
                if (!String.IsNullOrEmpty(key2))
                {
                    var data = tLogic.UnapprovedWorkTime(user.UserId);
                    dynamicDict[key2] = data;
                }
                if (!String.IsNullOrEmpty(key3))
                {
                    var data = tLogic.ProjectCount();
                    dynamicDict[key3] = data;
                }
            }
            return(Json(dynamicDict));
        }
Пример #2
0
        public void CheckForWin()
        {
            bool active   = true;
            bool expected = true;

            TilesLogic tl     = new TilesLogic();
            bool       actual = tl.CheckForWin();

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void CheckNewGame()
        {
            int tilesPerEdge       = 3;
            int randomShufflePower = 4;

            bool[,] expected;
            expected = new bool[tilesPerEdge, tilesPerEdge];

            TilesLogic tl = new TilesLogic();

            // bool actual = tl.NewGame(tilesPerEdge, randomShufflePower);


            Assert.AreEqual(expected, tl.isTileActive);
        }
Пример #4
0
        public void CheckWhichButtonWasClicked()
        {
            int column = 3;
            int row    = 4;

            bool[,] expected;
            expected = new bool[column, row];
            expected[column, row] ^= true;

            TilesLogic tl = new TilesLogic();

            tl.ProcessInput(column, row);

            bool[,] actual = tl.isTileActive;
            Assert.AreEqual(expected, actual);
        }