Navigation :
Introduction
FAQ
Setup, deployment & projects
Getting started
Examples
Catel.Core
Catel.MVVM
Catel.Fody
Catel.ReSharper
Tips & tricks
API reference
-
Catel.Cores
--
Catel
---
Catel.Android
---
Catel.ApiCop
---
Catel.Caching
---
Catel.Collections
---
Catel.ComponentModel
---
Catel.Configuration
---
Catel.Core
---
Catel.Data
---
Catel.ExceptionHandling
---
Catel.IO
---
Catel.IoC
---
Catel.Linq
---
Catel.Logging
---
Catel.Messaging
---
Catel.Pooling
---
Catel.Reflection
---
Catel.Runtime
---
Catel.Scoping
---
Catel.Services
---
Catel.Test
---- ExceptionTester
---
Catel.Text
---
Catel.Threading
--- Argument
--- AsyncEventHandler
--- AsyncEventHandlerExtensions
--- ByteArrayExtensions
--- CatelEnvironment
--- CompositeFilter
--- CompositePredicate
--- CoreModule
--- DesignTimeCodeAttribute
--- DesignTimeHelper
--- DesignTimeInitializer
--- Disposable
--- DisposableToken
--- Enum
--- EnvironmentHelper
--- EventHandlerExtensions
--- ExceptionExtensions
--- ExceptionFactory
--- ExpressionHelper
--- FastDateTime
--- HashHelper
--- IBindableEnum
--- ICommandManagerExtensions
--- ICompositeFilter
--- IDisposableToken
--- IExecute
--- IExecuteWithObject
--- IFluent
--- INotifyPropertyChangedExtensions
--- IUniqueIdentifyable
--- IWeakAction
--- IWeakEventListener
--- IWeakFunc
--- IWeakReference
--- JsonExtensions
--- KnownPlatforms
--- LanguageHelper
--- MVVMModule
--- MustBeImplementedException
--- NotSupportedInPlatformException
--- ObjectHelper
--- ObjectToStringHelper
--- OpenInstanceActionHandler
--- OpenInstanceEventHandler
--- ParallelHelper
--- Platforms
--- ProcessExtensions
--- ProgressContext
--- ResourceHelper
--- SerializationJsonModule
--- StringExtensions
--- StringToObjectHelper
--- SupportedPlatforms
--- TagHelper
--- ThemeHelper
--- ThreadHelper
--- UniqueIdentifierHelper
--- UriExtensions
--- WeakAction
--- WeakActionBase
--- WeakEventListener
--- WeakFunc
--
Systems
-
Catel.MVVMs
-
Catel.Serialization.Jsons
ExceptionTester
Name
Value
Assembly
Catel.Core
Namespace
Catel.Test
Available on
.NET Framework 4.5, .NET Framework 4.6, Portable Class Libraries, Xamarin - Android, Xamarin - iOS
public static class ExceptionTester
Class that helps test methods for expected exceptions.
Methods
CallMethodAndExpectException<TException>(Action action, Func<TException, bool> exceptionValidator)
Calls the method and checks for the exception. If no exception is thrown by the method, this method will throw an exception. If the wrong exception is thrown by the delegate, this method will thrown an exception as well.
Type Parameters
TException
The type of the exception.
Parameters
Name
Description
action
The action to execute.
exceptionValidator
The exception validator. Ifnull
, the exception will not be validated custom.
Returns
The exception so it can be further analyzed if required.
Exceptions
Name
Description
ArgumentNullException
The action isnull
.
Have a question about Catel? Use StackOverflow with the Catel tag!
Discussion
Please enable JavaScript to view the comments powered by Disqus.