Пример #1
0
        public void TestIfWpfGameStartMethodCallsEnginesStartMethod()
        {
            int calls = 0;
            var game = new WpfGame();

            Isolate.WhenCalled(() => game.Engine.StartGame()).DoInstead(context =>
            {
                calls++;
            });

            game.Start();
            
            Assert.AreEqual(1, calls);
        }
Пример #2
0
 private void StartGame(object sender, RoutedEventArgs e)
 {
     var playerName = this.PlayerName.Text;
     Game game = new WpfGame();
     game.Initialize();
     this.engine = game.Engine;
     this.engine.Player.Name = playerName;
     var renderer = this.engine.Renderer as WpfRenderer;
     renderer.MainWindow = this;
     this.InputGrid.Visibility = Visibility.Hidden;
     this.gridPlayField.Visibility = Visibility.Visible;
     this.Menu.Visibility = Visibility.Visible;
     game.Start();
 }