コード例 #1
0
        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"));
        }
コード例 #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();
     }
 }
コード例 #3
0
ファイル: TcpChannel.cs プロジェクト: jmptrader/griffin
        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));
        }