<commit_before>#include "game_mode.hpp"
#include "mock_controller.hpp"
#include "mock_observer.hpp"
#include "mock_view.hpp"

#include <gtest/gtest.h>
#include <gmock/gmock.h>
using ::testing::Return;

#include <stdexcept>
using namespace std;

namespace {
  class DISABLED_GameModeTest : public ::testing::Test {
  protected:
    DISABLED_GameModeTest() {
    }

    virtual ~DISABLED_GameModeTest() {
    }

    virtual void SetUp() {
    }

    virtual void TearDown() {
    }

  };

  TEST_F(DISABLED_GameModeTest, GetsAndProcessEventsFromController) {

    MockController mc;
    MockView mv;
    GameMode gm(&mc, &mv);

    EXPECT_CALL(mc,check_events())
      .WillOnce(Return(false))
      .WillOnce(Return(true));
    EXPECT_CALL(mc,handle_event());

    // First call will get nothing
    gm.update_game(10);
    // Second call will get an event and process it
    gm.update_game(10);

  }

  TEST_F(DISABLED_GameModeTest, UsesViewToRenderTheContent) {
    MockController mc;
    MockView mv;
    GameMode gm(&mc, &mv);

    EXPECT_CALL(mv, render_game()).Times(1);

    gm.render_game();
  }

  TEST_F(DISABLED_GameModeTest, AddObserversToControllerAndView) {
    MockObserver o;
    MockController mc;
    MockView mv;
    
    GameMode gm(&mc, &mv);

    EXPECT_CALL(mc, add_observer(&o));
    EXPECT_CALL(o, handle_event(12));

    gm.add_observer(&o);<commit_msg>Test cleanup.<commit_after>#include "game_mode.hpp"
#include "mock_controller.hpp"
#include "mock_observer.hpp"
#include "mock_view.hpp"

#include <gtest/gtest.h>
#include <gmock/gmock.h>
using ::testing::Return;

#include <stdexcept>
using namespace std;

namespace {
  class GameModeTest : public ::testing::Test {
  protected:
    GameModeTest() {
    }

    virtual ~GameModeTest() {
    }

    virtual void SetUp() {
    }

    virtual void TearDown() {
    }

  };

  TEST_F(GameModeTest, GetsAndProcessEventsFromController) {

    MockController mc;
    MockView mv;
    GameMode gm(&mc, &mv);

    EXPECT_CALL(mc,check_events())
      .WillOnce(Return(false))
      .WillOnce(Return(true));
    EXPECT_CALL(mc,handle_event());

    // First call will get nothing
    gm.update_game(10);
    // Second call will get an event and process it
    gm.update_game(10);

  }

  TEST_F(GameModeTest, UsesViewToRenderTheContent) {
    MockController mc;
    MockView mv;
    GameMode gm(&mc, &mv);

    EXPECT_CALL(mv, render_game()).Times(1);

    gm.render_game();
  }

  TEST_F(GameModeTest, AddObserversToControllerAndView) {
    MockObserver o;
    MockController mc;
    MockView mv;
    
    GameMode gm(&mc, &mv);

    EXPECT_CALL(mc, add_observer(&o));
    EXPECT_CALL(o, handle_event(12));

    gm.add_observer(&o);
{'fraction_non_alphanumeric': 0.12546262028127314, 'fraction_numerical': 0.0051813471502590676, 'mean_word_length': 3.558178752107926, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5090497', 'n_tokens_mistral': 984, 'n_tokens_neox': 949, 'n_words': 182}