Ejemplo n.º 1
0
        public async Task FindClanAsync_ShouldBeOfTypeClan()
        {
            // Arrange
            TestMock.ClanRepository.Setup(repository => repository.FindClanAsync(It.IsAny <ClanId>())).ReturnsAsync(new Clan("test", new UserId())).Verifiable();

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

            // Act
            var result = await service.FindClanAsync(new ClanId());

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

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