public void ValidEditSave()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;
            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            Genre moba = new Genre {
                GenreId = 1, Name = "Moba", Description = "Angry team simulator."
            };
            VideoGame game1 = new VideoGame
            {
                VideoGameId = 1,
                Name        = "CS:GO",
                Price       = 20,
                Developer   = "UK",
                Publisher   = "Steam",
                Description = "FPS Game",
                Genre       = moba
            };
            ViewResult result = controller.Edit(1) as ViewResult;

            // Assert
            Assert.AreEqual("Edit", result.ViewName);
        }
        public void CreateInvalid()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;
            Genre fps = new Genre {
                Name = "FPS", Description = "First-person shooter."
            };
            Genre moba = new Genre {
                GenreId = 100, Name = "Moba", Description = "Angry team simulator."
            };
            VideoGame game1 = new VideoGame
            {
                VideoGameId = 3,
                Name        = "CS : GO",
                Price       = 20,
                Developer   = "UK",
                Publisher   = "Steam",
                Description = "FPS Game",
                Genre       = fps
            };
            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            ViewResult result = controller.Create(game1) as ViewResult;

            // Assert
            Assert.AreEqual("Create", result.ViewName);
        }
        public void NotTestCase()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = false;
            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            //controller.Index();
            // Assert
            Assert.AreEqual(false, controller.testCase);
        }
        public void IndexTest()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;
            //Act
            ViewResult result = controller.Index() as ViewResult;

            //Assert
            Assert.AreEqual(result.ViewName, "Index");
        }
        public void Dispose()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;
            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            controller.Dispose();
            // Assert
            Assert.IsTrue(true);
        }
        public void DeleteConfirmedValidId()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;
            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            System.Web.Mvc.RedirectToRouteResult actual = (System.Web.Mvc.RedirectToRouteResult)controller.DeleteConfirmed(1);
            // Assert
            Assert.AreEqual("VideoGames", actual.RouteValues["action"]);
        }
        public void CreateView()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;
            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            ViewResult result = controller.Create() as ViewResult;

            // Assert
            Assert.AreEqual("Create", result.ViewName);
        }
        public void DetailValidId()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;
            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            ViewResult result = controller.Details(3) as ViewResult;

            // Assert
            Assert.IsNotNull(result.ViewName);
        }
        public void InvalidEdit()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;
            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            ViewResult result = controller.Edit(200) as ViewResult;

            // Assert
            Assert.AreEqual("Error", result.ViewName);
        }
        public void AddReview()
        {
            //Arrange
            FakeVideoGamesBL     fake       = new FakeVideoGamesBL();
            VideoGamesController controller = new VideoGamesController(fake);

            controller.testCase = true;

            //var result = (VideoGame)((ViewResult)controller.Details(1)).Model;
            // Act
            string result = controller.AddReview(1, 1, "test", 5, "test");

            // Assert
            Assert.AreEqual("Success", result);
        }