Search Results for

    Show / Hide Table of Contents

    Class FileAssert

    Asserts on Files

    Inheritance
    object
    AssertBase
    FileAssert
    Inherited Members
    AssertBase.ConvertMessageWithArgs(string, object[])
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Legacy
    Assembly: nunit.framework.legacy.dll
    Syntax
    public abstract class FileAssert : AssertBase

    Constructors

    View Source

    FileAssert()

    Declaration
    protected FileAssert()

    Methods

    View Source

    AreEqual(FileInfo, FileInfo)

    Verifies that two files are equal. Two files are considered equal if both are null, or if both have the same value byte for byte. If they are not equal an AssertionException is thrown.

    Declaration
    public static void AreEqual(FileInfo expected, FileInfo actual)
    Parameters
    Type Name Description
    FileInfo expected

    A file containing the value that is expected

    FileInfo actual

    A file containing the actual value

    View Source

    AreEqual(FileInfo, FileInfo, string, params object?[]?)

    Verifies that two files are equal. Two files are considered equal if both are null, or if both have the same value byte for byte. If they are not equal an AssertionException is thrown.

    Declaration
    public static void AreEqual(FileInfo expected, FileInfo actual, string message, params object?[]? args)
    Parameters
    Type Name Description
    FileInfo expected

    A file containing the value that is expected

    FileInfo actual

    A file containing the actual value

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    View Source

    AreEqual(Stream?, Stream?)

    Verifies that two Streams are equal. Two Streams are considered equal if both are null, or if both have the same value byte for byte. If they are not equal an AssertionException is thrown.

    Declaration
    public static void AreEqual(Stream? expected, Stream? actual)
    Parameters
    Type Name Description
    Stream expected

    The expected Stream

    Stream actual

    The actual Stream

    View Source

    AreEqual(Stream?, Stream?, string, params object?[]?)

    Verifies that two Streams are equal. Two Streams are considered equal if both are null, or if both have the same value byte for byte. If they are not equal an AssertionException is thrown.

    Declaration
    public static void AreEqual(Stream? expected, Stream? actual, string message, params object?[]? args)
    Parameters
    Type Name Description
    Stream expected

    The expected Stream

    Stream actual

    The actual Stream

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    View Source

    AreEqual(string, string)

    Verifies that two files are equal. Two files are considered equal if both are null, or if both have the same value byte for byte. If they are not equal an AssertionException is thrown.

    Declaration
    public static void AreEqual(string expected, string actual)
    Parameters
    Type Name Description
    string expected

    The path to a file containing the value that is expected

    string actual

    The path to a file containing the actual value

    View Source

    AreEqual(string, string, string, params object?[]?)

    Verifies that two files are equal. Two files are considered equal if both are null, or if both have the same value byte for byte. If they are not equal an AssertionException is thrown.

    Declaration
    public static void AreEqual(string expected, string actual, string message, params object?[]? args)
    Parameters
    Type Name Description
    string expected

    The path to a file containing the value that is expected

    string actual

    The path to a file containing the actual value

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    View Source

    AreNotEqual(FileInfo, FileInfo)

    Asserts that two files are not equal. If they are equal an AssertionException is thrown.

    Declaration
    public static void AreNotEqual(FileInfo expected, FileInfo actual)
    Parameters
    Type Name Description
    FileInfo expected

    A file containing the value that is expected

    FileInfo actual

    A file containing the actual value

    View Source

    AreNotEqual(FileInfo, FileInfo, string, params object?[]?)

    Asserts that two files are not equal. If they are equal an AssertionException is thrown.

    Declaration
    public static void AreNotEqual(FileInfo expected, FileInfo actual, string message, params object?[]? args)
    Parameters
    Type Name Description
    FileInfo expected

    A file containing the value that is expected

    FileInfo actual

    A file containing the actual value

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    View Source

    AreNotEqual(Stream?, Stream?)

    Asserts that two Streams are not equal. If they are equal an AssertionException is thrown.

    Declaration
    public static void AreNotEqual(Stream? expected, Stream? actual)
    Parameters
    Type Name Description
    Stream expected

    The expected Stream

    Stream actual

    The actual Stream

    View Source

    AreNotEqual(Stream?, Stream?, string, params object?[]?)

    Asserts that two Streams are not equal. If they are equal an AssertionException is thrown.

    Declaration
    public static void AreNotEqual(Stream? expected, Stream? actual, string message, params object?[]? args)
    Parameters
    Type Name Description
    Stream expected

    The expected Stream

    Stream actual

    The actual Stream

    string message

    The message to be displayed when the two Stream are the same.

    object[] args

    Arguments to be used in formatting the message

    View Source

    AreNotEqual(string, string)

    Asserts that two files are not equal. If they are equal an AssertionException is thrown.

    Declaration
    public static void AreNotEqual(string expected, string actual)
    Parameters
    Type Name Description
    string expected

    The path to a file containing the value that is expected

    string actual

    The path to a file containing the actual value

    View Source

    AreNotEqual(string, string, string, params object?[]?)

    Asserts that two files are not equal. If they are equal an AssertionException is thrown.

    Declaration
    public static void AreNotEqual(string expected, string actual, string message, params object?[]? args)
    Parameters
    Type Name Description
    string expected

    The path to a file containing the value that is expected

    string actual

    The path to a file containing the actual value

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    View Source

    DoesNotExist(FileInfo)

    Asserts that the file does not exist. If it does exist an AssertionException is thrown.

    Declaration
    public static void DoesNotExist(FileInfo actual)
    Parameters
    Type Name Description
    FileInfo actual

    A file containing the actual value

    View Source

    DoesNotExist(FileInfo, string, params object?[]?)

    Asserts that the file does not exist. If it does exist an AssertionException is thrown.

    Declaration
    public static void DoesNotExist(FileInfo actual, string message, params object?[]? args)
    Parameters
    Type Name Description
    FileInfo actual

    A file containing the actual value

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    View Source

    DoesNotExist(string)

    Asserts that the file 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 file containing the actual value

    View Source

    DoesNotExist(string, string, params object?[]?)

    Asserts that the file 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 file containing the actual value

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    View Source

    Exists(FileInfo)

    Asserts that the file exists. If it does not exist an AssertionException is thrown.

    Declaration
    public static void Exists(FileInfo actual)
    Parameters
    Type Name Description
    FileInfo actual

    A file containing the actual value

    View Source

    Exists(FileInfo, string, params object?[]?)

    Asserts that the file exists. If it does not exist an AssertionException is thrown.

    Declaration
    public static void Exists(FileInfo actual, string message, params object?[]? args)
    Parameters
    Type Name Description
    FileInfo actual

    A file containing the actual value

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    View Source

    Exists(string)

    Asserts that the file 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 file containing the actual value

    View Source

    Exists(string, string, params object?[]?)

    Asserts that the file 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 file containing the actual value

    string message

    The message to display if Streams are not equal

    object[] args

    Arguments to be used in formatting the message

    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0