Skip to content

Commit

Permalink
Minor cleanup of tests.
Browse files Browse the repository at this point in the history
Commenting and organized imports.
  • Loading branch information
joshuapinter committed Apr 5, 2014
1 parent a83b2c2 commit cbe3c4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/src/com/activeandroid/test/CacheTest.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.activeandroid.test;

import android.test.AndroidTestCase;

import com.activeandroid.ActiveAndroid;
import com.activeandroid.Cache;
import com.activeandroid.Configuration;
import com.activeandroid.Model;
import com.activeandroid.TableInfo;
import com.activeandroid.annotation.Table;

import android.test.AndroidTestCase;

import java.util.Collection;

public class CacheTest extends AndroidTestCase {
Expand Down
10 changes: 7 additions & 3 deletions tests/src/com/activeandroid/test/ModelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@

import com.activeandroid.Model;
import com.activeandroid.annotation.Table;

import java.util.HashSet;
import java.util.Set;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;

/**
* Simple test now covering equals and hashcode methods.
Expand Down Expand Up @@ -58,7 +57,7 @@ public void testEqualsOnNew() {

assertFalse(model1.equals(model2));
assertFalse(model2.equals(model1));
assertTrue(model1.equals(model1));//equal only to itself
assertTrue(model1.equals(model1)); //equal only to itself
}

/**
Expand All @@ -73,10 +72,15 @@ public void testEqualsDifferentRows() {
model2.save();
model3 = Model.load(MockModel.class, model1.getId());

// Not equal to each other.
assertFalse(model1.equals(model2));
assertFalse(model2.equals(model1));

// Equal to each other when loaded.
assertTrue(model1.equals(model3));
assertTrue(model1.equals(model3));

// Loaded model is not equal to a different model.
assertFalse(model3.equals(model2));
assertFalse(model2.equals(model3));
}
Expand Down

0 comments on commit cbe3c4a

Please sign in to comment.