CK.Core.Tests.CKExceptionTests.CheckSimpleExceptionData C# (CSharp) Method

CheckSimpleExceptionData() private static method

private static CheckSimpleExceptionData ( CKExceptionData simpleData, bool>.Func message, bool hasInner = null, bool hasStack = true ) : void
simpleData CKExceptionData
message bool>.Func
hasInner bool
hasStack bool
return void
        private static void CheckSimpleExceptionData( CKExceptionData simpleData, Func<string,bool> message, bool? hasInner = null, bool hasStack = true )
        {
            Assert.That( message(simpleData.Message), "Invalid message." );
            Assert.That( simpleData.ExceptionTypeName, Is.EqualTo( "Exception" ) );
            Assert.That( simpleData.ExceptionTypeAssemblyQualifiedName, Is.EqualTo( typeof( Exception ).AssemblyQualifiedName ) );
            
            if( hasStack ) 
                Assert.That( simpleData.StackTrace, Is.Not.Null, "Stack trace is not null when the exception has actually been thrown." );
            else Assert.That( simpleData.StackTrace, Is.Null );

            if( hasInner.HasValue )
            {
                if( hasInner.Value ) Assert.That( simpleData.InnerException, Is.Not.Null );
                else Assert.That( simpleData.InnerException, Is.Null );
            }
            Assert.That( simpleData.AggregatedExceptions, Is.Null );
            Assert.That( simpleData.LoaderExceptions, Is.Null );
        }