AssertException

Overview

Represents a special exception that is thrown by the Assert class to signal assertation failure and handled by the Runner core.

Instead of using this exception directly you can use methods of the Assert class to detect and singal about failed tests.

For example, all following methods will throw AssertException:

Assert.IsTrue(False); 
Assert.IsEmpty("abc");
Assert.Fail("Test failed");

Location

Properties


Message  virtual    (declared in BaseException) Toffee

 

var Message: String { get{} }

ParsableMessage  virtual    (declared in BaseException)

 

property ParsableMessage: String read;

 

String ParsableMessage { get; }

 

var ParsableMessage: String { get{} }

 

String ParsableMessage { __get; }

 

ReadOnly Property ParsableMessage() As String

Instance Methods


constructor .NET, .NET Standard 2.0, Cooper, Island, macOS

 

// .NET, .NET Standard 2.0
constructor(aMessage: String; aFile: String := nil; aLine: Int32 := nil; aClass: String := nil; aMethod: String := nil; aType: String := 'TEST')
// Island
constructor(aMessage: String; aFile: String; aLine: Int32; aClass: String; aMethod: String; aType: String := 'TEST')
// macOS
constructor(aMessage: String; aFile: String; aLine: Int32; aClass: String; aMethod: String; aType: String)

 

// .NET, .NET Standard 2.0
AssertException(String aMessage, String aFile = null, Int32 aLine = null, String aClass = null, String aMethod = null, String aType = \"TEST\")
// Island
AssertException(String aMessage, String aFile, Int32 aLine, String aClass, String aMethod, String aType = \"TEST\")
// macOS
AssertException(String aMessage, String aFile, Int32 aLine, String aClass, String aMethod, String aType)

 

// .NET, .NET Standard 2.0
init(_ aMessage: String, _ aFile: String = nil, _ aLine: Int32 = nil, _ aClass: String = nil, _ aMethod: String = nil, _ aType: String = \"TEST\")
// Island
init(_ aMessage: String, _ aFile: String, _ aLine: Int32, _ aClass: String, _ aMethod: String, _ aType: String = \"TEST\")
// macOS
init(_ aMessage: String, _ aFile: String, _ aLine: Int32, _ aClass: String, _ aMethod: String, _ aType: String)

 

AssertException(String aMessage, String aFile, Integer aLine, String aClass, String aMethod, String aType)

 

// .NET, .NET Standard 2.0
Sub New(aMessage As String, aFile As String = Null, aLine As Int32 = Null, aClass As String = Null, aMethod As String = Null, aType As String = \"TEST\")
// Island
Sub New(aMessage As String, aFile As String, aLine As Int32, aClass As String, aMethod As String, aType As String = \"TEST\")
// macOS
Sub New(aMessage As String, aFile As String, aLine As Int32, aClass As String, aMethod As String, aType As String)

Parameters:

  • aMessage:
  • aFile:
  • aLine:
  • aClass:
  • aMethod:
  • aType: