Esempio n. 1
0
 @Test
 public void testRemovingElementWhichIsNotPresent() {
   ImagesBuffer buffer = ImagesBuffer.getInstance();
   buffer.clear();
   buffer.removeEntry("dasd");
   Assert.assertEquals(0, buffer.size());
 }
Esempio n. 2
0
 @Test
 public void testGettingElementWhichIsNotPresent() {
   ImagesBuffer buffer = ImagesBuffer.getInstance();
   buffer.clear();
   BufferedImage im = buffer.getEntry("dasd");
   Assert.assertEquals(null, im);
 }
Esempio n. 3
0
 @Test
 public void testAddingTheSameEntires() {
   ImagesBuffer buffer = ImagesBuffer.getInstance();
   buffer.clear();
   buffer.addEntry("all", "cards.jpg");
   buffer.addEntry("all", "cards.jpg");
   Assert.assertEquals(1, buffer.size());
 }
Esempio n. 4
0
 @Test
 public void testWetherAfterAddingEntryNumberOfEntriesEcountered() {
   ImagesBuffer buffer = ImagesBuffer.getInstance();
   buffer.clear();
   buffer.addEntry("all", "cards.jpg");
   int size = buffer.size();
   Assert.assertEquals(1, size);
 }
Esempio n. 5
0
  @Test
  public void testAddingBufferedImageUnderKeyAndRetrievingIt() {
    ImagesBuffer buffer = ImagesBuffer.getInstance();
    buffer.addEntry("all", "cards.jpg");
    BufferedImage image = buffer.getEntry("all");
    Assert.assertNotNull(image);
    // buffer.splitImagesFromSource("cards.jpg",50,100);
    // CardNode node= new CardNode(new Card(Card.Name.ACE,Card.Suit.SPADE));

  }
Esempio n. 6
0
 @Test
 public void testWetherAfterAddingEntryAndRemovingItSizesAreChanging() {
   ImagesBuffer buffer = ImagesBuffer.getInstance();
   buffer.clear();
   buffer.addEntry("all", "cards.jpg");
   Assert.assertEquals(1, buffer.size());
   buffer.removeEntry("all");
   Assert.assertEquals(0, buffer.size());
 }
Esempio n. 7
0
 public PassButton() {
   this.img = ImagesBuffer.getInstance().getEntry("passButton");
 }