public void TestItRegisterAnOnGameRecordHandlerCorrectly()
    {
        subject.RegisterOnGameRecord(delegate(GameRecord game) {
            return(Arg.Any <bool> ());
        });

        serverMock.Received().RegisterHandler(
            Arg.Any <short>(),
            Arg.Any <NetworkMessageDelegate>()
            );
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        NetworkServerContainer server  = new NetworkServerContainer();
        MessageFactory         factory = new MessageFactory();

        server.Listen(Port);

        GameHistoryService gameHistory = new GameHistoryService(
            new GameRecordStore()
            );

        GameHistoryServerMessenger gameHistoryServerMessenger = new GameHistoryServerMessenger(
            server,
            factory
            );

        gameHistoryServerMessenger.RegisterOnGameRecord(gameHistory.RegisterGame);
        gameHistoryServerMessenger.RegisterOnPlayerProfile(gameHistory.ForPlayer);
        gameHistoryServerMessenger.RegisterOnAllGames(gameHistory.All);
    }