public void GetSnapshotEventWithIdDoesNotExistThrowsTest() { _repositoryMock .Setup(x => x.GetSingleOrDefault(It.IsAny <int>())) .Returns((Event)null); var exception = Assert.Throws <BusinessException>(() => _eventAccessor.GetSnapshot(1)); _repositoryMock.Verify(x => x.GetSingleOrDefault(It.Is <int>(y => y == 1)), Times.Once); Assert.Equal("Event with id 1 doesn't exist", exception.Message); }