Beispiel #1
0
        public void Test_StartSession_ReturnsIdForSession()
        {
            var gameId = 6667;

            var game = new Game()
            {
                Id = gameId
            };

            _mockGameStorage.GetSingle(game.Id).Returns(game.Some());

            var errands = Enumerable.Range(1, 6).Select(i => new Errand {
                Id = i, Description = "Errand " + i
            });

            _mockGameErrandStorage.GetForGame(game.Id).Returns(errands);

            var guid = Guid.NewGuid();

            _mockGameSessionStorage.CreateSession(game, errands).Returns(guid);

            var result = _service.StartSession(gameId);

            Assert.AreEqual(guid, result);
        }