Ejemplo n.º 1
0
        public void Setup()
        {
            GamingInfo _gi = new GamingInfo()
            {
                GameId       = 1, GameTitle = "Halo", GameDescription = "Good Game", ReleaseDate = DateTime.Today,
                GamePlatform = 1, GameCategory = 1, GamePrice = 10
            };

            _dbContext.GamingInfo.Add(_gi);
            _dbContext.SaveChanges();

            BusinessGames _bg = new BusinessGames()
            {
                BusinessId = 1, GameId = 1
            };

            _dbContext.BusinessGames.Add(_bg);
            _dbContext.SaveChanges();

            GamingPlatform _pl = new GamingPlatform()
            {
                PlatformId = 1, PlatformName = "SNES"
            };

            _dbContext.GamingPlatform.Add(_pl);
            _dbContext.SaveChanges();

            GamingCategory _ca = new GamingCategory()
            {
                CategoryId = 1, CategoryName = "Puzzle"
            };

            _dbContext.GamingCategory.Add(_ca);
            _dbContext.SaveChanges();
        }
Ejemplo n.º 2
0
        public void CheckCategory_InsertId_ReturnName()
        {
            var controller = new GameController(_dbContext);

            string         category = "Puzzle";
            GamingCategory cat      = new GamingCategory();

            cat.CategoryId = 1;

            string getName = controller.GetGameCategory(cat.CategoryId);

            Assert.AreEqual(getName, category);
        }