예제 #1
0
        public void AddTestTest()
        {
            var resultBefore = _repo.GetAllTests().Count;
            var id           = Guid.NewGuid();

            _repo.AddTest(new Test()
            {
                CompleteTime = DateTime.Now,
                Id           = id,
                Username     = "******"
            });

            var resultAfter = _repo.GetAllTests().Count;

            Assert.AreEqual(1, resultAfter - resultBefore);

            _repo.RemoveTestByGuid(id);
        }
예제 #2
0
        public ActionResult Result()
        {
            if (Session["WinnerId"] == null)
            {
                return(RedirectToAction("Index"));
            }

            var test = ((Test)Session["Test"]);

            test.Id           = new Guid();
            test.CompleteTime = DateTime.Now;
            _testsRepo.AddTest(test);

            int styleId = ((int)Session["WinnerId"]);
            var result  = _imgRepo.GetStyleById(styleId);

            Session.Abandon();

            return(PartialView(result));
        }