CSharpTest.Net
Greater Than Operator
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Bases Namespace > Comparable<T> Class : Greater Than Operator

a
b

Glossary Item Box

Compares two objects

Syntax

Visual Basic (Declaration) 
Public Operator >( _
   ByVal a As Comparable(Of T), _
   ByVal b As Comparable(Of T) _
) As Boolean
C# 
public bool operator >( 
   Comparable<T> a,
   Comparable<T> b
)

Parameters

a
b

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.NETCopy 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

Generated with Document! X 2011 by Innovasys