public static void ConfiguringSetterWithNull(
            Exception exception)
        {
            "When assignment of a property is configured using a null expression"
                .x(() => exception = Record.Exception(() => A.CallToSet<int>(null)));

            "Then an argument null exception is thrown"
                .x(() => exception.Should().BeAnExceptionOfType<ArgumentNullException>());

            "And the parameter name is 'propertySpecification'"
                .x(() => exception.As<ArgumentNullException>().ParamName.Should().Be("propertySpecification"));
        }
Exemplo n.º 2
0
 public void ReadException(Exception exception)
 {
     if (exception is AggregateException)
     {
         ExceptionText = exception.As<AggregateException>()
             .InnerExceptions.Select(x => x.ToString())
             .Join(ExceptionSeparator);
     }
     else
     {
         ExceptionText = exception.ToString();
     }
 }
Exemplo n.º 3
0
        protected void ReportException(Exception exception)
        {
            if (exception is SocketException)
            {
                var ex = exception.As<SocketException>();
                SendUpstream(new SocketClosedEvent(_localEndPoint, _remoteEndPoint, ex.SocketErrorCode));
                return;
            }

            SendUpstream(new ExceptionEvent(exception));
        }