コード例 #1
0
        public async Task GetRegionByIdAsync_CallingTheRepository_ShouldReturnTheRegion()
        {
            // Arrange
            moqRepository.Setup(x => x.GetRegionByIdAsync(It.IsAny <int>())).ReturnsAsync(expectedRegion);

            // Act
            var actualRegion = await service.GetRegionByIdAsync(regionId);

            // Assert
            moqRepository.VerifyAll();
            Assert.AreEqual(expectedRegion, actualRegion);
        }