You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/TestFramework/Assert.cs
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,29 @@ public static void False(
108
108
109
109
#region Equal
110
110
111
+
/// <summary>
112
+
/// Tests whether the specified objects are equal and throws an exception if the two objects are not equal.
113
+
/// </summary>
114
+
/// <param name="expected">The first objects to compare. This is the objects the tests expects.</param>
115
+
/// <param name="actual">The second objects to compare. This is the objects produced by the code under test.</param>
116
+
/// <param name="message"> The message to include in the exception when <paramref name="actual"/> is not equal to <paramref name="expected"/>. The message is shown in test results.</param>
117
+
/// <exception cref="AssertFailedException">Thrown if <paramref name="expected"/> is not equal to <paramref name="actual"/>.</exception>
118
+
publicstaticvoidAreEqual(
119
+
objectexpected,
120
+
objectactual,
121
+
stringmessage="")
122
+
{
123
+
if(expected==actual)
124
+
{
125
+
return;
126
+
}
127
+
128
+
HandleAreEqualFail(
129
+
expected,
130
+
actual,
131
+
message);
132
+
}
133
+
111
134
/// <summary>
112
135
/// Tests whether the specified values are equal and throws an exception if the two values are not equal.
113
136
/// </summary>
@@ -699,6 +722,29 @@ public static void Equal(
699
722
700
723
#region NotEqual
701
724
725
+
/// <summary>
726
+
/// Tests whether the specified object are not equal and throws an exception if the two object are equal.
727
+
/// </summary>
728
+
/// <param name="notExpected">The first object to compare. This is the object the tests expects.</param>
729
+
/// <param name="actual">The second object to compare. This is the object produced by the code under test.</param>
730
+
/// <param name="message"> The message to include in the exception when <paramref name="actual"/> is equal to <paramref name="notExpected"/>. The message is shown in test results.</param>
731
+
/// <exception cref="AssertFailedException">Thrown if <paramref name="notExpected"/> is equal to <paramref name="actual"/>.</exception>
732
+
publicstaticvoidAreNotEqual(
733
+
objectnotExpected,
734
+
objectactual,
735
+
stringmessage="")
736
+
{
737
+
if(notExpected!=actual)
738
+
{
739
+
return;
740
+
}
741
+
742
+
HandleAreNotEqualFail(
743
+
notExpected,
744
+
actual,
745
+
message);
746
+
}
747
+
702
748
/// <summary>
703
749
/// Tests whether the specified values are not equal and throws an exception if the two values are equal.
0 commit comments