Compares two objects
Syntax
Example
Library/Library.Test/TestEquatable.cs
C# | Copy Code |
---|
Null<int> nil = null;
Null<int> a = 5;
Null<int> b1 = 6;
Null<int> b2 = 6;
Assert.IsTrue(null >= nil);
Assert.IsTrue(nil >= null);
Assert.IsTrue(b1 >= b2);
Assert.IsFalse(a >= b1);
Assert.IsTrue(b1 >= a);
Assert.IsFalse(nil >= a);
Assert.IsTrue(a >= nil);
Assert.IsFalse(null >= a);
Assert.IsTrue(a >= null);
Assert.IsFalse(null > nil);
Assert.IsFalse(nil > null);
Assert.IsFalse(b1 > b2);
Assert.IsFalse(a > b1);
Assert.IsTrue(b1 > a);
Assert.IsFalse(nil > a);
Assert.IsTrue(a > nil);
Assert.IsFalse(null > a);
Assert.IsTrue(a > null); |
VB.NET | Copy Code |
---|
Dim nil As Null(Of Integer) = Nothing
Dim a As Null(Of Integer) = 5
Dim b1 As Null(Of Integer) = 6
Dim b2 As Null(Of Integer) = 6
Assert.IsTrue(Nothing >= nil)
Assert.IsTrue(nil >= Nothing)
Assert.IsTrue(b1 >= b2)
Assert.IsFalse(a >= b1)
Assert.IsTrue(b1 >= a)
Assert.IsFalse(nil >= a)
Assert.IsTrue(a >= nil)
Assert.IsFalse(Nothing >= a)
Assert.IsTrue(a >= Nothing)
Assert.IsFalse(Nothing > nil)
Assert.IsFalse(nil > Nothing)
Assert.IsFalse(b1 > b2)
Assert.IsFalse(a > b1)
Assert.IsTrue(b1 > a)
Assert.IsFalse(nil > a)
Assert.IsTrue(a > nil)
Assert.IsFalse(Nothing > a)
Assert.IsTrue(a > Nothing) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also