Пример #1
0
        public void Ensure_exception_logged_as_error()
        {
            var mockLog = new Mock <ILog <SampleApplication> >();

            var application = new SampleApplication(mockLog.Object);

            application.MethodThatHandlesException();

            mockLog.Verify(x => x.LogError(It.IsAny <Exception>(), "An error occurred"), Times.Once);
        }