Package ns.foundation

Examples of ns.foundation.NSRange


import ns.foundation.NSRange;

public class TestNSRange extends BaseTestCase {

  public void testNSRange() {
    NSRange range = new NSRange();
    assertEquals(new NSRange(0,0), range);
  }
View Full Code Here


    NSRange range = new NSRange();
    assertEquals(new NSRange(0,0), range);
  }

  public void testNSRangeIntInt() {
    NSRange range = new NSRange(2,3);
    assertEquals(2, range.location());
    assertEquals(3, range.length());
  }
View Full Code Here

    assertEquals(2, range.location());
    assertEquals(3, range.length());
  }

  public void testNSRangeNSRange() {
    NSRange range = new NSRange(1,1);
    NSRange otherRange = new NSRange(range);
    assertEquals(range, otherRange);
  }
View Full Code Here

    NSRange otherRange = new NSRange(range);
    assertEquals(range, otherRange);
  }

  public void testLocation() {
    NSRange range = new NSRange(2,3);
    assertEquals(2, range.location());
  }
View Full Code Here

    NSRange range = new NSRange(2,3);
    assertEquals(2, range.location());
  }

  public void testLength() {
    NSRange range = new NSRange(2,3);
    assertEquals(3, range.length());
  }
View Full Code Here

    NSRange range = new NSRange(2,3);
    assertEquals(3, range.length());
  }

  public void testEqualsObject() {
    NSRange range = new NSRange(2,3);
    NSRange otherRange = new NSRange(2, 3);
    assertTrue(range.equals(otherRange));
   
    otherRange = new NSRange(3, 3);
    assertFalse(range.equals(otherRange));
   
    otherRange = null;
    assertFalse(range.equals(otherRange));
   
View Full Code Here

    otherRange = new NSMutableRange(2, 3);
    assertTrue(range.equals(otherRange));
  }
 
  public void testIsEqualToRange() {
    NSRange range = new NSRange(2,3);
    NSRange otherRange = new NSRange(2, 3);
    assertTrue(range.isEqualToRange(otherRange));
   
    otherRange = new NSRange(3, 3);
    assertFalse(range.isEqualToRange(otherRange));
  }
View Full Code Here

    otherRange = new NSRange(3, 3);
    assertFalse(range.isEqualToRange(otherRange));
  }

  public void testToString() {
    NSRange range = new NSRange(2,3);
    assertEquals("{2, 3}", range.toString());
  }
View Full Code Here

    NSRange range = new NSRange(2,3);
    assertEquals("{2, 3}", range.toString());
  }

  public void testClone() {
    NSRange range = new NSRange(2,3);
    NSRange clone = (NSRange) range.clone();
    assertEquals(range, clone);
  }
View Full Code Here

    NSRange clone = (NSRange) range.clone();
    assertEquals(range, clone);
  }

  public void testContainsLocation() {
    NSRange range = new NSRange(2,3);
    assertFalse(range.containsLocation(1));
    assertTrue(range.containsLocation(2));
    assertTrue(range.containsLocation(4));
    assertFalse(range.containsLocation(5));
  }
View Full Code Here

TOP

Related Classes of ns.foundation.NSRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.