コード例 #1
0
        public async Task GetPlayerProgress_WithNoExistingPlayerProgress_GetEmptyNewOne()
        {
            var repository     = new PlayerProgressRepository(_context);
            var playerProgress = await repository.GetPlayerProgress("player2", 2);

            playerProgress.Should().NotBeNull();
            playerProgress.PlayerId.Should().Be("player2");
            playerProgress.QuestId.Should().Be(2);
            playerProgress.QuestPointsEarned.Should().Be(0);
        }
コード例 #2
0
        public async Task GetPlayerProgress_WithExistingPlayerProgress_GetCorrectOne()
        {
            var repository     = new PlayerProgressRepository(_context);
            var playerProgress = await repository.GetPlayerProgress("player1", 1);

            playerProgress.Should().NotBeNull();
            playerProgress.PlayerId.Should().Be("player1");
            playerProgress.QuestId.Should().Be(1);
            playerProgress.QuestPointsEarned.Should().Be(1);
        }
コード例 #3
0
        public async Task GetPlayerProgress_WithEmptyContext_GetEmptyNewOne()
        {
            _context.PlayerProgresses.RemoveRange(_context.PlayerProgresses);
            _context.SaveChanges();

            var repository     = new PlayerProgressRepository(_context);
            var playerProgress = await repository.GetPlayerProgress("player1", 1);

            playerProgress.Should().NotBeNull();
            playerProgress.PlayerId.Should().Be("player1");
            playerProgress.QuestId.Should().Be(1);
            playerProgress.QuestPointsEarned.Should().Be(0);
        }