コード例 #1
0
        public void Models_VisitTruckViewModel_Default_Instantiate_Should_Pass()
        {
            // Act
            var result = new VisitTruckViewModel();

            // Assert
            Assert.IsNotNull(result, TestContext.TestName);
        }
コード例 #2
0
ファイル: ShopController.cs プロジェクト: alymlk/5051
        /// <summary>
        ///  List of Shops to Visit
        /// </summary>
        /// <returns>List of Students that you can visit</returns>
        public ActionResult Visit(string id = null)
        {
            // Temp hold the Student Id for the Nav, until the Nav can call for Identity.
            ViewBag.StudentId = id;

            var data = new VisitTruckViewModel();

            // TODO
            // Make a List of the Student IDs for now.  Update this to a Shop Datastructure
            //var data = DataSourceBackend.Instance.StudentBackend.Index();

            // Get Student
            var myStudent = DataSourceBackend.Instance.StudentBackend.Read(id);

            if (myStudent == null)
            {
                // Send back for Edit
                return(RedirectToAction("Index", "Shop", new { id }));
            }

            data.Student = myStudent;

            // Get LeaderBoard
            data.LeaderBoard = DataSourceBackend.Instance.GameBackend.GetLeaderBoard();

            foreach (var student in DataSourceBackend.Instance.StudentBackend.Index())
            {
                _5051.Backend.GameBackend.Instance.GetResult(student.Id);
            }

            // Get the list of other students' shop
            // it will show the name of the student's shop and its owner
            // then, once students click on the specific student's shop
            // he/she can go visiting it

            data.StudentList = DataSourceBackend.Instance.StudentBackend.Index();

            return(View(data));
        }