Ejemplo n.º 1
0
        public async Task FetchClansAsync_ShouldBeOfTypeClanList()
        {
            // Arrange
            TestMock.ClanRepository.Setup(repository => repository.FetchClansAsync())
            .ReturnsAsync(
                new List <Clan>
            {
                new Clan("test", new UserId()),
                new Clan("test", new UserId()),
                new Clan("test", new UserId())
            })
            .Verifiable();

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

            // Act
            var result = await service.FetchClansAsync();

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

            TestMock.ClanRepository.Verify(repository => repository.FetchClansAsync(), Times.Once);
        }