public Game CreateGame(string title, ApplicationUser owner)
        {
            Game my_game= new Game { Title = title, Owner = owner };
            context.MyGames.Add(my_game);
            context.SaveChanges(); // This saves something to the Database

            return my_game;
        }
        public void GameRepositoryEnsureICanAddGameInformation()
        {
            GameRepository game_repo = new GameRepository(mock_context.Object);
                Game newgame = new Game{ Title = "MyGame", GameId = 1};
                my_game.Add(new GameInformation{ ScoreHoleOne = 6, GameInformationId = 7 });

                ConnectMocksToDataSource();

                bool actual = my_game.AddGameInformation(1, newgame);

                Assert.AreEqual(1, game_repo.GetGameCount());
                Assert.IsTrue(actual);
        }
Example #3
0
 public void NewGameInformationEnsurePropertiesWork()
 {
     Game newgame = new Game { Title = "Marsie's Golf Games" };
 }
Example #4
0
 public void NewGameEnsureICanCreateInstance()
 {
     Game newgame = new Game();
     Assert.IsNotNull(newgame);
 }
 public void GolfCourseInformationEnsurePropertiesWork()
 {
     Game newgame = new Game { ScoreHoleOne = 3 };
 }
 public void GolfCourseInformationEnsureICanCreateInstance()
 {
     Game newgame = new Game();
     Assert.IsNotNull(newgame);
 }