Exemple #1
0
        public async Task FetchMembersAsync_ShouldBeOfTypeMemberList()
        {
            // Arrange
            var ownerId = new UserId();
            var clan    = new Clan("test", ownerId);

            TestMock.ClanRepository.Setup(repository => repository.FetchMembersAsync(It.IsAny <ClanId>()))
            .ReturnsAsync(
                new List <Member>
            {
                new Member(clan.Id, ownerId)
            })
            .Verifiable();

            var service = new ClanService(TestMock.ClanRepository.Object);

            // Act
            var result = await service.FetchMembersAsync(clan);

            // Assert
            result.Should().BeOfType <List <Member> >();

            TestMock.ClanRepository.Verify(repository => repository.FetchMembersAsync(It.IsAny <ClanId>()), Times.Once);
        }