コード例 #1
0
        public void ReturnsValidData()
        {
            bool result = true;
            List <List <string> > response = MinesweeperWorker.GetRandomGrid();

            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    if ((response[i][j] != "bomb") && (response[i][j] != "empty"))
                    {
                        result = false;
                        break;
                    }
                }
            }
            Assert.IsTrue(result);
        }
コード例 #2
0
        public void ReturnsListOfListOfStrings()
        {
            object response = MinesweeperWorker.GetRandomGrid();

            Assert.AreSame(response.GetType(), typeof(List <List <string> >));
        }
コード例 #3
0
 public ActionResult Data()
 {
     return(Json(MinesweeperWorker.GetRandomGrid(), JsonRequestBehavior.AllowGet));
 }