public void TestCompareToZdo() { ZigBeeEndpointAddress address1 = new ZigBeeEndpointAddress(25000); ZigBeeEndpointAddress address2 = new ZigBeeEndpointAddress(25000); Assert.Equal(0, address1.CompareTo(address2)); ZigBeeEndpointAddress address3 = new ZigBeeEndpointAddress("25001"); Assert.Equal(-1, address1.CompareTo(address3)); }
public void TestCompareTo() { ZigBeeEndpointAddress address1 = new ZigBeeEndpointAddress("25000/33"); ZigBeeEndpointAddress address2 = new ZigBeeEndpointAddress("25000/33"); Assert.Equal(0, address1.CompareTo(address2)); ZigBeeEndpointAddress address3 = new ZigBeeEndpointAddress("25001/33"); Assert.True(address1.CompareTo(address3) < 0); ZigBeeEndpointAddress address4 = new ZigBeeEndpointAddress("24999/33"); Assert.True(address1.CompareTo(address4) > 0); ZigBeeEndpointAddress address5 = new ZigBeeEndpointAddress("25000/30"); Assert.True(address1.CompareTo(address5) > 0); ZigBeeEndpointAddress address6 = new ZigBeeEndpointAddress("25000/36"); Assert.True(address1.CompareTo(address6) < 0); }