Exemple #1
0
        public GameServicesTest()
        {
            var configuration = new Mock <IConfiguration>();

            config = new Mock <Config>(configuration.Object);
            config.Setup(c => c.AllActions).Returns("(InitGame|ClientConnect|ClientUserinfoChanged|Kill)");
            config.Setup(c => c.LogPathName).Returns("C:\\test");
            config.Setup(c => c.World).Returns(1024);

            var mockLogInfraServices = new Mock <ILogProcessInfraServices>();

            mockLogInfraServices
            .Setup(g => g.Load())
            .Returns(LogMocks.GetListGames());

            mockGameServices = new Mock <GameServices>(mockLogInfraServices.Object, config.Object);
        }
Exemple #2
0
        public GamesApplicationTest()
        {
            var mockGameServices = new Mock <IGameServices>();

            mockGameServices
            .Setup(g => g.GetAll())
            .Returns(LogMocks.GetListGames());

            mockGameServices
            .Setup(g => g.GetWithoutWorld(1))
            .Returns(new List <DTO.Games>()
            {
                LogMocks.GetGame(1)
            });

            mockGameServices
            .Setup(g => g.GetWithoutWorld(null))
            .Returns(LogMocks.GetListGames());

            mockGamesApplication = new Mock <GamesApplication>(mockGameServices.Object);
        }