Exemplo n.º 1
0
        public async Task DeleteAsync_UnknownIdPassed_ThrowAnException()
        {
            // Arrange
            int familyId = 11;

            _repositoryMock
            .Setup(rep => rep.GetByIdAsync(familyId))
            .ReturnsAsync(TestData.GetFamilyById(familyId));

            // Act
            var exception = await Assert.ThrowsAsync <Exception>(() => _familyService.DeleteAsync(familyId));

            // Assert
            Assert.NotNull(exception);
        }