Assert.AreNotSequenceEqual 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AreNotSequenceEqual(IEnumerable, IEnumerable, IEqualityComparer, SequenceOrder, String, String, String)
测试两个序列是否使用指定的比较器和顺序语义不同,如果两个序列不同,则引发异常。
public static void AreNotSequenceEqual(System.Collections.IEnumerable? notExpected, System.Collections.IEnumerable? actual, System.Collections.IEqualityComparer? comparer, Microsoft.VisualStudio.TestTools.UnitTesting.SequenceOrder order, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotSequenceEqual : System.Collections.IEnumerable * System.Collections.IEnumerable * System.Collections.IEqualityComparer * Microsoft.VisualStudio.TestTools.UnitTesting.SequenceOrder * string * string * string -> unit
Public Shared Sub AreNotSequenceEqual (notExpected As IEnumerable, actual As IEnumerable, comparer As IEqualityComparer, order As SequenceOrder, Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
参数
- notExpected
- IEnumerable
序列不应等于 actual。
- actual
- IEnumerable
由所测试的代码生成的序列。
- comparer
- IEqualityComparer
比较元素时要使用的相等比较器,或使用 null 默认比较器。
- order
- SequenceOrder
指定元素是必须按相同顺序显示还是按任意顺序显示。
- message
- String
序列相等时要包含在异常中的消息。
- notExpectedExpression
- String
由编译器通过调用方参数表达式给出的 notExpectic 表达式的语法表达式。
- actualExpression
- String
编译器通过调用方参数表达式给出的实际语法表达式。
适用于
AreNotSequenceEqual(IEnumerable, IEnumerable, IEqualityComparer, String, String, String)
使用指定的比较器测试两个序列是否以相同顺序不同,如果两个序列不同,则引发异常。
public static void AreNotSequenceEqual(System.Collections.IEnumerable? notExpected, System.Collections.IEnumerable? actual, System.Collections.IEqualityComparer? comparer, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotSequenceEqual : System.Collections.IEnumerable * System.Collections.IEnumerable * System.Collections.IEqualityComparer * string * string * string -> unit
Public Shared Sub AreNotSequenceEqual (notExpected As IEnumerable, actual As IEnumerable, comparer As IEqualityComparer, Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
参数
- notExpected
- IEnumerable
序列不应等于 actual。
- actual
- IEnumerable
由所测试的代码生成的序列。
- comparer
- IEqualityComparer
比较元素时要使用的相等比较器,或使用 null 默认比较器。
- message
- String
序列相等时要包含在异常中的消息。
- notExpectedExpression
- String
由编译器通过调用方参数表达式给出的 notExpectic 表达式的语法表达式。
- actualExpression
- String
编译器通过调用方参数表达式给出的实际语法表达式。
适用于
AreNotSequenceEqual(IEnumerable, IEnumerable, String, String, String)
测试两个序列是否以相同顺序不同,如果两个序列不同,则引发异常。
public static void AreNotSequenceEqual(System.Collections.IEnumerable? notExpected, System.Collections.IEnumerable? actual, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotSequenceEqual : System.Collections.IEnumerable * System.Collections.IEnumerable * string * string * string -> unit
Public Shared Sub AreNotSequenceEqual (notExpected As IEnumerable, actual As IEnumerable, Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
参数
- notExpected
- IEnumerable
序列不应等于 actual。
- actual
- IEnumerable
由所测试的代码生成的序列。
- message
- String
序列相等时要包含在异常中的消息。
- notExpectedExpression
- String
由编译器通过调用方参数表达式给出的 notExpectic 表达式的语法表达式。
- actualExpression
- String
编译器通过调用方参数表达式给出的实际语法表达式。
适用于
AreNotSequenceEqual(IEnumerable, IEnumerable, SequenceOrder, String, String, String)
测试两个序列是否使用指定的顺序语义不同,如果未指定序列,则会引发异常。
public static void AreNotSequenceEqual(System.Collections.IEnumerable? notExpected, System.Collections.IEnumerable? actual, Microsoft.VisualStudio.TestTools.UnitTesting.SequenceOrder order, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotSequenceEqual : System.Collections.IEnumerable * System.Collections.IEnumerable * Microsoft.VisualStudio.TestTools.UnitTesting.SequenceOrder * string * string * string -> unit
Public Shared Sub AreNotSequenceEqual (notExpected As IEnumerable, actual As IEnumerable, order As SequenceOrder, Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
参数
- notExpected
- IEnumerable
序列不应等于 actual。
- actual
- IEnumerable
由所测试的代码生成的序列。
- order
- SequenceOrder
指定元素是必须按相同顺序显示还是按任意顺序显示。
- message
- String
序列相等时要包含在异常中的消息。
- notExpectedExpression
- String
由编译器通过调用方参数表达式给出的 notExpectic 表达式的语法表达式。
- actualExpression
- String
编译器通过调用方参数表达式给出的实际语法表达式。
适用于
AreNotSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, String, String, String)
测试两个序列是否以相同顺序不同,如果两个序列不同,则引发异常。
public static void AreNotSequenceEqual<T>(System.Collections.Generic.IEnumerable<T>? notExpected, System.Collections.Generic.IEnumerable<T>? actual, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotSequenceEqual : seq<'T> * seq<'T> * string * string * string -> unit
Public Shared Sub AreNotSequenceEqual(Of T) (notExpected As IEnumerable(Of T), actual As IEnumerable(Of T), Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
类型参数
- T
序列元素的类型。
参数
- notExpected
- IEnumerable<T>
序列不应等于 actual。
- actual
- IEnumerable<T>
由所测试的代码生成的序列。
- message
- String
序列相等时要包含在异常中的消息。
- notExpectedExpression
- String
由编译器通过调用方参数表达式给出的 notExpectic 表达式的语法表达式。
- actualExpression
- String
编译器通过调用方参数表达式给出的实际语法表达式。
适用于
AreNotSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, SequenceOrder, String, String, String)
测试两个序列是否使用指定的顺序语义不同,如果未指定序列,则会引发异常。
public static void AreNotSequenceEqual<T>(System.Collections.Generic.IEnumerable<T>? notExpected, System.Collections.Generic.IEnumerable<T>? actual, Microsoft.VisualStudio.TestTools.UnitTesting.SequenceOrder order, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotSequenceEqual : seq<'T> * seq<'T> * Microsoft.VisualStudio.TestTools.UnitTesting.SequenceOrder * string * string * string -> unit
Public Shared Sub AreNotSequenceEqual(Of T) (notExpected As IEnumerable(Of T), actual As IEnumerable(Of T), order As SequenceOrder, Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
类型参数
- T
序列元素的类型。
参数
- notExpected
- IEnumerable<T>
序列不应等于 actual。
- actual
- IEnumerable<T>
由所测试的代码生成的序列。
- order
- SequenceOrder
指定元素是必须按相同顺序显示还是按任意顺序显示。
- message
- String
序列相等时要包含在异常中的消息。
- notExpectedExpression
- String
由编译器通过调用方参数表达式给出的 notExpectic 表达式的语法表达式。
- actualExpression
- String
编译器通过调用方参数表达式给出的实际语法表达式。
适用于
AreNotSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, String, String)
使用指定的比较器测试两个序列是否以相同顺序不同,如果两个序列不同,则引发异常。
public static void AreNotSequenceEqual<T>(System.Collections.Generic.IEnumerable<T>? notExpected, System.Collections.Generic.IEnumerable<T>? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotSequenceEqual : seq<'T> * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> * string * string * string -> unit
Public Shared Sub AreNotSequenceEqual(Of T) (notExpected As IEnumerable(Of T), actual As IEnumerable(Of T), comparer As IEqualityComparer(Of T), Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
类型参数
- T
序列元素的类型。
参数
- notExpected
- IEnumerable<T>
序列不应等于 actual。
- actual
- IEnumerable<T>
由所测试的代码生成的序列。
- comparer
- IEqualityComparer<T>
比较元素时要使用的相等比较器,或使用 null 默认比较器。
- message
- String
序列相等时要包含在异常中的消息。
- notExpectedExpression
- String
由编译器通过调用方参数表达式给出的 notExpectic 表达式的语法表达式。
- actualExpression
- String
编译器通过调用方参数表达式给出的实际语法表达式。
适用于
AreNotSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, SequenceOrder, String, String, String)
测试两个序列是否使用指定的比较器和顺序语义不同,如果两个序列不同,则引发异常。
public static void AreNotSequenceEqual<T>(System.Collections.Generic.IEnumerable<T>? notExpected, System.Collections.Generic.IEnumerable<T>? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, Microsoft.VisualStudio.TestTools.UnitTesting.SequenceOrder order, string? message = "", string notExpectedExpression = "", string actualExpression = "");
static member AreNotSequenceEqual : seq<'T> * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> * Microsoft.VisualStudio.TestTools.UnitTesting.SequenceOrder * string * string * string -> unit
Public Shared Sub AreNotSequenceEqual(Of T) (notExpected As IEnumerable(Of T), actual As IEnumerable(Of T), comparer As IEqualityComparer(Of T), order As SequenceOrder, Optional message As String = "", Optional notExpectedExpression As String = "", Optional actualExpression As String = "")
类型参数
- T
序列元素的类型。
参数
- notExpected
- IEnumerable<T>
序列不应等于 actual。
- actual
- IEnumerable<T>
由所测试的代码生成的序列。
- comparer
- IEqualityComparer<T>
比较元素时要使用的相等比较器,或使用 null 默认比较器。
- order
- SequenceOrder
指定元素是必须按相同顺序显示还是按任意顺序显示。
- message
- String
序列相等时要包含在异常中的消息。
- notExpectedExpression
- String
由编译器通过调用方参数表达式给出的 notExpectic 表达式的语法表达式。
- actualExpression
- String
编译器通过调用方参数表达式给出的实际语法表达式。