Ejemplo n.º 1
0
        public void Setup()
        {
            _memoryStoreClient = new Mock <IMemoryStoreClient>(MockBehavior.Strict);
            _transaction       = new Mock <ITransaction>(MockBehavior.Strict);
            _transaction.Setup(tx => tx.Dispose());
            _authClient = new Mock <PlayerAuthServiceClient>(MockBehavior.Strict);
            var memoryStoreClientManager = new Mock <IMemoryStoreClientManager <IMemoryStoreClient> >();

            memoryStoreClientManager.Setup(manager => manager.GetClient()).Returns(_memoryStoreClient.Object);
            _memoryStoreClient.Setup(client => client.CreateTransaction()).Returns(_transaction.Object);
            _memoryStoreClient.Setup(client => client.Dispose());
            _service = new GatewayServiceImpl(memoryStoreClientManager.Object, _authClient.Object);
        }
        public void Setup()
        {
            _party = new Party(LeaderId, Pit);
            _party.AddPlayerToParty(PlayerId, Pit);

            _transaction = new Mock <ITransaction>(MockBehavior.Strict);
            _transaction.Setup(tx => tx.Dispose());

            _memClient = new Mock <IMemoryStoreClient>(MockBehavior.Strict);
            _memClient.Setup(client => client.CreateTransaction()).Returns(_transaction.Object);
            _memClient.Setup(client => client.Dispose());

            var memoryStoreClientManager = new Mock <IMemoryStoreClientManager <IMemoryStoreClient> >();

            memoryStoreClientManager.Setup(manager => manager.GetClient()).Returns(_memClient.Object);
            _service = new GatewayServiceImpl(memoryStoreClientManager.Object, null);
        }