public async Task Should_map_ReadPartition_and_return_the_expected_ninja() { // Arrange var clanName = "My clan"; var entities = new NinjaEntity[0]; var expectedNinja = new Ninja[0]; NinjaEntityTableStorageRepositoryMock .Setup(x => x.ReadPartitionAsync(clanName)) .ReturnsAsync(entities) .Verifiable(); NinjaMappingServiceMock .Setup(x => x.Map(entities)) .Returns(expectedNinja) .Verifiable(); // Act var result = await RepositoryUnderTest.ReadAllInClanAsync(clanName); // Assert NinjaMappingServiceMock .Verify(x => x.Map(entities), Times.Once); NinjaEntityTableStorageRepositoryMock .Verify(x => x.ReadPartitionAsync(clanName), Times.Once); Assert.Same(expectedNinja, result); }