Example #1
0
        protected override void Given()
        {
            base.Given();
            var cpuPlayer = new Player {UserName = null};

            cpuPlayer = Load(cpuPlayer);
            cpuId = cpuPlayer.Id;
            FlushSessionAndEvict(cpuPlayer);
            var settingsProvider = new StubCabalSettingsProvider(new CabalSection {Server = new ServerElement {CpuPlayerId = cpuId}});
            playerRepository = new PlayerRepository(NHibernateSession, settingsProvider);
        }
Example #2
0
        protected override void Given()
        {
            base.Given();
            var settingsProvider = new StubCabalSettingsProvider(50);

            GameRepository = new GameRepository(NHibernateSession);
            PlayerRepository = new PlayerRepository(NHibernateSession, settingsProvider);

            ServiceUnderTest = new GameService(GameRepository, PlayerRepository);

            ExpectedGame = Build.Game();
            ExpectedGame.Owner.UserName = OwnerName;
            ExpectedGame.Start(ExpectedGame.Owner);
            GameRepository.Save(ExpectedGame);
            FlushSessionAndEvict(ExpectedGame);
        }