This topic has not yet been rated - Rate this topic

Assert Methods

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

The Assert type exposes the following members.

  Name Description
Public method Static member AreEqual(Object, Object) Verifies that two specified objects are equal. The assertion fails if the objects are not equal.
Public method Static member AreEqual(Double, Double, Double) Verifies that two specified doubles are equal, or within the specified accuracy of each other. The assertion fails if they are not within the specified accuracy of each other.
Public method Static member AreEqual(Object, Object, String) Verifies that two specified objects are equal. The assertion fails if the objects are not equal. Displays a message if the assertion fails.
Public method Static member AreEqual(Single, Single, Single) Verifies that two specified singles are equal, or within the specified accuracy of each other. The assertion fails if they are not within the specified accuracy of each other.
Public method Static member AreEqual(String, String, Boolean) Verifies that two specified strings are equal, ignoring case or not as specified. The assertion fails if they are not equal.
Public method Static member AreEqual(Double, Double, Double, String) Verifies that two specified doubles are equal, or within the specified accuracy of each other. The assertion fails if they are not within the specified accuracy of each other. Displays a message if the assertion fails.
Public method Static member AreEqual(Object, Object, String, Object[]) Verifies that two specified objects are equal. The assertion fails if the objects are not equal. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreEqual(Single, Single, Single, String) Verifies that two specified singles are equal, or within the specified accuracy of each other. The assertion fails if they are not within the specified accuracy of each other. Displays a message if the assertion fails.
Public method Static member AreEqual(String, String, Boolean, CultureInfo) Verifies that two specified strings are equal, ignoring case or not as specified, and using the culture info specified. The assertion fails if they are not equal.
Public method Static member AreEqual(String, String, Boolean, String) Verifies that two specified strings are equal, ignoring case or not as specified. The assertion fails if they are not equal. Displays a message if the assertion fails.
Public method Static member AreEqual(Double, Double, Double, String, Object[]) Verifies that two specified doubles are equal, or within the specified accuracy of each other. The assertion fails if they are not within the specified accuracy of each other. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreEqual(Single, Single, Single, String, Object[]) Verifies that two specified singles are equal, or within the specified accuracy of each other. The assertion fails if they are not within the specified accuracy of each other. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreEqual(String, String, Boolean, CultureInfo, String) Verifies that two specified strings are equal, ignoring case or not as specified, and using the culture info specified. The assertion fails if they are not equal. Displays a message if the assertion fails.
Public method Static member AreEqual(String, String, Boolean, String, Object[]) Verifies that two specified strings are equal, ignoring case or not as specified. The assertion fails if they are not equal. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreEqual(String, String, Boolean, CultureInfo, String, Object[]) Verifies that two specified strings are equal, ignoring case or not as specified, and using the culture info specified. The assertion fails if they are not equal. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreEqual<T>(T, T) Verifies that two specified generic type data are equal by using the equality operator. The assertion fails if they are not equal.
Public method Static member AreEqual<T>(T, T, String) Verifies that two specified generic type data are equal by using the equality operator. The assertion fails if they are not equal. Displays a message if the assertion fails.
Public method Static member AreEqual<T>(T, T, String, Object[]) Verifies that two specified generic type data are equal by using the equality operator. The assertion fails if they are not equal. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreNotEqual(Object, Object) Verifies that two specified objects are not equal. The assertion fails if the objects are equal.
Public method Static member AreNotEqual(Double, Double, Double) Verifies that two specified doubles are not equal, and not within the specified accuracy of each other. The assertion fails if they are equal or within the specified accuracy of each other.
Public method Static member AreNotEqual(Object, Object, String) Verifies that two specified objects are not equal. The assertion fails if the objects are equal. Displays a message if the assertion fails.
Public method Static member AreNotEqual(Single, Single, Single) Verifies that two specified singles are not equal, and not within the specified accuracy of each other. The assertion fails if they are equal or within the specified accuracy of each other.
Public method Static member AreNotEqual(String, String, Boolean) Verifies that two specified strings are not equal, ignoring case or not as specified. The assertion fails if they are equal.
Public method Static member AreNotEqual(Double, Double, Double, String) Verifies that two specified doubles are not equal, and not within the specified accuracy of each other. The assertion fails if they are equal or within the specified accuracy of each other. Displays a message if the assertion fails.
Public method Static member AreNotEqual(Object, Object, String, Object[]) Verifies that two specified objects are not equal. The assertion fails if the objects are equal. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreNotEqual(Single, Single, Single, String) Verifies that two specified singles are not equal, and not within the specified accuracy of each other. The assertion fails if they are equal or within the specified accuracy of each other. Displays a message if the assertion fails.
Public method Static member AreNotEqual(String, String, Boolean, CultureInfo) Verifies that two specified strings are not equal, ignoring case or not as specified, and using the culture info specified. The assertion fails if they are equal.
Public method Static member AreNotEqual(String, String, Boolean, String) Verifies that two specified strings are not equal, ignoring case or not as specified. The assertion fails if they are equal. Displays a message if the assertion fails.
Public method Static member AreNotEqual(Double, Double, Double, String, Object[]) Verifies that two specified doubles are not equal, and not within the specified accuracy of each other. The assertion fails if they are equal or within the specified accuracy of each other. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreNotEqual(Single, Single, Single, String, Object[]) Verifies that two specified singles are not equal, and not within the specified accuracy of each other. The assertion fails if they are equal or within the specified accuracy of each other. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreNotEqual(String, String, Boolean, CultureInfo, String) Verifies that two specified strings are not equal, ignoring case or not as specified, and using the culture info specified. The assertion fails if they are equal. Displays a message if the assertion fails.
Public method Static member AreNotEqual(String, String, Boolean, String, Object[]) Verifies that two specified strings are not equal, ignoring case or not as specified. The assertion fails if they are equal. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreNotEqual(String, String, Boolean, CultureInfo, String, Object[]) Verifies that two specified strings are not equal, ignoring case or not as specified, and using the culture info specified. The assertion fails if they are equal. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreNotEqual<T>(T, T) Verifies that two specified generic type data are not equal. The assertion fails if they are equal.
Public method Static member AreNotEqual<T>(T, T, String) Verifies that two specified generic type data are not equal. The assertion fails if they are equal. Displays a message if the assertion fails.
Public method Static member AreNotEqual<T>(T, T, String, Object[]) Verifies that two specified generic type data are not equal. The assertion fails if they are equal. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreNotSame(Object, Object) Verifies that two specified object variables refer to different objects. The assertion fails if they refer to the same object.
Public method Static member AreNotSame(Object, Object, String) Verifies that two specified object variables refer to different objects. The assertion fails if they refer to the same object. Displays a message if the assertion fails.
Public method Static member AreNotSame(Object, Object, String, Object[]) Verifies that two specified object variables refer to different objects. The assertion fails if they refer to the same object. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member AreSame(Object, Object) Verifies that two specified object variables refer to the same object. The assertion fails if they refer to different objects.
Public method Static member AreSame(Object, Object, String) Verifies that two specified object variables refer to the same object. The assertion fails if they refer to different objects. Displays a message if the assertion fails.
Public method Static member AreSame(Object, Object, String, Object[]) Verifies that two specified object variables refer to the same object. The assertion fails if they refer to different objects. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member Equals Determines whether two objects are equal.
Public method Static member Fail() Fails the assertion without checking any conditions.
Public method Static member Fail(String) Fails the assertion without checking any conditions. Displays a message.
Public method Static member Fail(String, Object[]) Fails the assertion without checking any conditions. Displays a message, and applies the specified formatting to it.
Public method Static member Inconclusive() Indicates that the assertion cannot be verified.
Public method Static member Inconclusive(String) Indicates that the assertion can not be verified. Displays a message.
Public method Static member Inconclusive(String, Object[]) Indicates that an assertion can not be verified. Displays a message, and applies the specified formatting to it.
Public method Static member IsFalse(Boolean) Verifies that the specified condition is false. The assertion fails if the condition is true.
Public method Static member IsFalse(Boolean, String) Verifies that the specified condition is false. The assertion fails if the condition is true. Displays a message if the assertion fails.
Public method Static member IsFalse(Boolean, String, Object[]) Verifies that the specified condition is false. The assertion fails if the condition is true. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member IsInstanceOfType(Object, Type) Verifies that the specified object is an instance of the specified type. The assertion fails if the type is not found in the inheritance hierarchy of the object.
Public method Static member IsInstanceOfType(Object, Type, String) Verifies that the specified object is an instance of the specified type. The assertion fails if the type is not found in the inheritance hierarchy of the object. Displays a message if the assertion fails.
Public method Static member IsInstanceOfType(Object, Type, String, Object[]) Verifies that the specified object is an instance of the specified type. The assertion fails if the type is not found in the inheritance hierarchy of the object. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member IsNotInstanceOfType(Object, Type) Verifies that the specified object is not an instance of the specified type. The assertion fails if the type is found in the inheritance hierarchy of the object.
Public method Static member IsNotInstanceOfType(Object, Type, String) Verifies that the specified object is not an instance of the specified type. The assertion fails if the type is found in the inheritance hierarchy of the object. Displays a message if the assertion fails.
Public method Static member IsNotInstanceOfType(Object, Type, String, Object[]) Verifies that the specified object is not an instance of the specified type. The assertion fails if the type is found in the inheritance hierarchy of the object. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member IsNotNull(Object) Verifies that the specified object is not null. The assertion fails if it is null.
Public method Static member IsNotNull(Object, String) Verifies that the specified object is not null. The assertion fails if it is null. Displays a message if the assertion fails.
Public method Static member IsNotNull(Object, String, Object[]) Verifies that the specified object is not null. The assertion fails if it is null. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member IsNull(Object) Verifies that the specified object is null. The assertion fails if it is not null.
Public method Static member IsNull(Object, String) Verifies that the specified object is null. The assertion fails if it is not null. Displays a message if the assertion fails.
Public method Static member IsNull(Object, String, Object[]) Verifies that the specified object is null. The assertion fails if it is not null. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member IsTrue(Boolean) Verifies that the specified condition is true. The assertion fails if the condition is false.
Public method Static member IsTrue(Boolean, String) Verifies that the specified condition is true. The assertion fails if the condition is false. Displays a message if the assertion fails.
Public method Static member IsTrue(Boolean, String, Object[]) Verifies that the specified condition is true. The assertion fails if the condition is false. Displays a message if the assertion fails, and applies the specified formatting to it.
Public method Static member ReplaceNullChars In a string, replaces null characters ('\0') with "\\0".
Top
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.