Class DirectoryAssert
Asserts on Directories
Inherited Members
Namespace: NUnit.Framework.Legacy
Assembly: nunit.framework.legacy.dll
Syntax
public abstract class DirectoryAssert : AssertBase
Constructors
View SourceDirectoryAssert()
Declaration
protected DirectoryAssert()
Methods
View SourceAreEqual(DirectoryInfo, DirectoryInfo)
Verifies that two directories are equal. Two directories are considered equal if both are null, or if both point to the same directory. If they are not equal an AssertionException is thrown.
Declaration
public static void AreEqual(DirectoryInfo expected, DirectoryInfo actual)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | expected | A directory containing the value that is expected |
DirectoryInfo | actual | A directory containing the actual value |
AreEqual(DirectoryInfo, DirectoryInfo, string, params object?[]?)
Verifies that two directories are equal. Two directories are considered equal if both are null, or if both point to the same directory. If they are not equal an AssertionException is thrown.
Declaration
public static void AreEqual(DirectoryInfo expected, DirectoryInfo actual, string message, params object?[]? args)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | expected | A directory containing the value that is expected |
DirectoryInfo | actual | A directory containing the actual value |
string | message | The message to display if the directories are not equal |
object[] | args | Arguments to be used in formatting the message |
AreNotEqual(DirectoryInfo?, DirectoryInfo?)
Asserts that two directories are not equal. If they are equal an AssertionException is thrown.
Declaration
public static void AreNotEqual(DirectoryInfo? expected, DirectoryInfo? actual)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | expected | A directory containing the value that is expected |
DirectoryInfo | actual | A directory containing the actual value |
AreNotEqual(DirectoryInfo?, DirectoryInfo?, string, params object?[]?)
Asserts that two directories are not equal. If they are equal an AssertionException is thrown.
Declaration
public static void AreNotEqual(DirectoryInfo? expected, DirectoryInfo? actual, string message, params object?[]? args)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | expected | A directory containing the value that is expected |
DirectoryInfo | actual | A directory containing the actual value |
string | message | The message to display if directories are not equal |
object[] | args | Arguments to be used in formatting the message |
DoesNotExist(DirectoryInfo)
Asserts that the directory does not exist. If it does exist an AssertionException is thrown.
Declaration
public static void DoesNotExist(DirectoryInfo actual)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | actual | A directory containing the actual value |
DoesNotExist(DirectoryInfo, string, params object?[]?)
Asserts that the directory does not exist. If it does exist an AssertionException is thrown.
Declaration
public static void DoesNotExist(DirectoryInfo actual, string message, params object?[]? args)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | actual | A directory containing the actual value |
string | message | The message to display if directories are not equal |
object[] | args | Arguments to be used in formatting the message |
DoesNotExist(string)
Asserts that the directory does not exist. If it does exist an AssertionException is thrown.
Declaration
public static void DoesNotExist(string actual)
Parameters
Type | Name | Description |
---|---|---|
string | actual | The path to a directory containing the actual value |
DoesNotExist(string, string, params object?[]?)
Asserts that the directory does not exist. If it does exist an AssertionException is thrown.
Declaration
public static void DoesNotExist(string actual, string message, params object?[]? args)
Parameters
Type | Name | Description |
---|---|---|
string | actual | The path to a directory containing the actual value |
string | message | The message to display if directories are not equal |
object[] | args | Arguments to be used in formatting the message |
Exists(DirectoryInfo)
Asserts that the directory exists. If it does not exist an AssertionException is thrown.
Declaration
public static void Exists(DirectoryInfo actual)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | actual | A directory containing the actual value |
Exists(DirectoryInfo, string, params object?[]?)
Asserts that the directory exists. If it does not exist an AssertionException is thrown.
Declaration
public static void Exists(DirectoryInfo actual, string message, params object?[]? args)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | actual | A directory containing the actual value |
string | message | The message to display if directories are not equal |
object[] | args | Arguments to be used in formatting the message |
Exists(string)
Asserts that the directory exists. If it does not exist an AssertionException is thrown.
Declaration
public static void Exists(string actual)
Parameters
Type | Name | Description |
---|---|---|
string | actual | The path to a directory containing the actual value |
Exists(string, string, params object?[]?)
Asserts that the directory exists. If it does not exist an AssertionException is thrown.
Declaration
public static void Exists(string actual, string message, params object?[]? args)
Parameters
Type | Name | Description |
---|---|---|
string | actual | The path to a directory containing the actual value |
string | message | The message to display if directories are not equal |
object[] | args | Arguments to be used in formatting the message |