Package com.wesabe.api.util.guid

Examples of com.wesabe.api.util.guid.GUID


public class GUIDTest {
 
  public static class Generating_A_GUID {
    @Test
    public void shouldProduceARandomGUIDOfTheRequestedLength() throws Exception {
      GUID guid = GUID.generateRandom(40);
      assertEquals(40, guid.length());
    }
View Full Code Here


      assertEquals(40, guid.length());
    }
   
    @Test
    public void shouldBeAllHex() throws Exception {
      GUID guid = GUID.generateRandom(40);
     
      assertMatches("^[0-9a-f]+$", guid.toString());
    }
View Full Code Here

  }
 
  public static class Generating_A_GUID_Using_A_Different_Character_Set {
    @Test
    public void shouldBeAllHex() throws Exception {
      GUID guid = GUID.generateRandom(40, CharacterSet.SAFE_LOWERCASE_ALPHANUM);
     
     
      assertMatches("^[bcdfghjklmnpqrstvwxz0123456789]+$", guid.toString());
    }
View Full Code Here

  }
 
  public static class Two_Equivalent_GUIDs {
    @Test
    public void shouldBeEqual() throws Exception {
      GUID guid1 = new GUID("yay");
      GUID guid2 = new GUID("yay");
      assertEquals(guid1, guid2);
    }
View Full Code Here

      assertEquals(guid1, guid2);
    }
   
    @Test
    public void shouldHaveEqualHashCodes() throws Exception {
      GUID guid1 = new GUID("yay");
      GUID guid2 = new GUID("yay");
      assertEquals(guid1.hashCode(), guid2.hashCode());
    }
View Full Code Here

  }
 
  public static class Two_Different_GUIDs {
    @Test
    public void shouldNotBeEqual() throws Exception {
      GUID guid1 = new GUID("yay");
      GUID guid2 = new GUID("boo");
      assertFalse(guid1.equals(guid2));
    }
View Full Code Here

      assertFalse(guid1.equals(guid2));
    }
   
    @Test
    public void shouldHaveDifferentHashCodes() throws Exception {
      GUID guid1 = new GUID("yay");
      GUID guid2 = new GUID("boo");
      assertFalse(guid1.hashCode() == guid2.hashCode());
    }
View Full Code Here

  }
 
  public static class A_GUID {
    @Test
    public void shouldNotBeEqualToANonGUID() throws Exception {
      GUID guid1 = new GUID("yay");
      assertFalse(guid1.equals("yay"));
    }
View Full Code Here

      assertFalse(guid1.equals("yay"));
    }
   
    @Test
    public void shouldNotBeEqualToNull() throws Exception {
      GUID guid1 = new GUID("yay");
      assertFalse(guid1.equals(null));
    }
View Full Code Here

      assertFalse(guid1.equals(null));
    }
   
    @Test
    public void shouldBeEqualToItself() throws Exception {
      GUID guid1 = new GUID("yay");
      assertTrue(guid1.equals(guid1));
    }
View Full Code Here

TOP

Related Classes of com.wesabe.api.util.guid.GUID

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.