Index: issuevalue/src/test/java/geniusweb/issuevalue/DomainTest.java
===================================================================
--- issuevalue/src/test/java/geniusweb/issuevalue/DomainTest.java	(revision 29)
+++ issuevalue/src/test/java/geniusweb/issuevalue/DomainTest.java	(revision 30)
@@ -2,4 +2,5 @@
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
 import static org.mockito.Mockito.mock;
@@ -24,6 +25,10 @@
 
 public class DomainTest extends GeneralTests<Domain> {
+	private static final BigDecimal TWO = new BigDecimal("2");
+	private static final BigDecimal THREE = new BigDecimal("3");
+
 	private static final DiscreteValue I1V2 = new DiscreteValue("i1v2");
 	private static final DiscreteValue I1V1 = new DiscreteValue("i1v1");
+	private static final NumberValue I2V1 = new NumberValue(TWO);
 	private static final String DOMAINNAME = "testdomain";
 	private static final String ISSUE1 = "issue1";
@@ -33,6 +38,8 @@
 	private static final String domainstring = "{\"name\":\"testdomain\",\"issuesValues\":{\"issue2\":{\"range\":[2,3,0.22]},\"issue1\":{\"values\":[\"i1v1\",\"i1v2\"]}}}";
 
-	private static final String jobsstring = "{\"name\":\"jobs\"," + "\"issuesValues\":{"
-			+ "\"lease car\":{\"values\":[\"yes\",\"no\"]}," + "\"permanent contract\":{\"values\":[\"yes\",\"no\"]},"
+	private static final String jobsstring = "{\"name\":\"jobs\","
+			+ "\"issuesValues\":{"
+			+ "\"lease car\":{\"values\":[\"yes\",\"no\"]},"
+			+ "\"permanent contract\":{\"values\":[\"yes\",\"no\"]},"
 			+ "\"career development opportunities\":{\"values\":[\"low\",\"medium\",\"high\"]},"
 			+ "\"fte\":{\"values\":[\"0.6\",\"0.8\",\"1.0\"]},"
@@ -43,7 +50,4 @@
 	private static final ValueSet values1;
 	private static final ValueSet values2;
-	private static final BigDecimal TWO = new BigDecimal("2");
-	private static final BigDecimal THREE = new BigDecimal("3");
-
 	private static final Domain domain, domain1, domain2, domain3;
 
@@ -64,5 +68,6 @@
 		Map<String, ValueSet> issues1 = new HashMap<>();
 		issues1.put(ISSUE1, values1);
-		issues1.put(ISSUE2, new NumberValueSet(BigDecimal.ONE, TWO, new BigDecimal("0.22")));
+		issues1.put(ISSUE2, new NumberValueSet(BigDecimal.ONE, TWO,
+				new BigDecimal("0.22")));
 		domain3 = new Domain(DOMAINNAME, issues1);
 
@@ -71,10 +76,12 @@
 	@Override
 	public List<List<Domain>> getGeneralTestData() {
-		return Arrays.asList(Arrays.asList(domain, domain1), Arrays.asList(domain2), Arrays.asList(domain3));
+		return Arrays.asList(Arrays.asList(domain, domain1),
+				Arrays.asList(domain2), Arrays.asList(domain3));
 	}
 
 	@Override
 	public List<String> getGeneralTestStrings() {
-		return Arrays.asList("Domain.*testdomain.*", "Domain.*testdomain1.*", "Domain.*testdomain.*");
+		return Arrays.asList("Domain.*testdomain.*", "Domain.*testdomain1.*",
+				"Domain.*testdomain.*");
 	}
 
@@ -97,6 +104,7 @@
 		System.out.println(jobsstring);
 		Domain jobsdomain = jackson.readValue(jobsstring, Domain.class);
-		assertEquals(new HashSet<>(Arrays.asList("lease car", "permanent contract", "career development opportunities",
-				"fte", "salary", "work from home")), jobsdomain.getIssues());
+		assertEquals(new HashSet<>(Arrays.asList("lease car",
+				"permanent contract", "career development opportunities", "fte",
+				"salary", "work from home")), jobsdomain.getIssues());
 
 	}
@@ -121,5 +129,6 @@
 	public void testIsCompleteNoIssuesDefined() {
 		Bid bid = mock(Bid.class);
-		assertThat(domain.isComplete(bid), new PatternMatch("Issues in bid .* do not match issues in domain .*"));
+		assertThat(domain.isComplete(bid), new PatternMatch(
+				"Issues in bid .* do not match issues in domain .*"));
 	}
 
@@ -140,5 +149,6 @@
 		// THREE is NOT a possible value in the NumberValueSet.
 		when(bid.getValue(ISSUE2)).thenReturn(new NumberValue(THREE));
-		assertThat(domain.isComplete(bid), new PatternMatch("bid issue issue2 has illegal value 3"));
+		assertThat(domain.isComplete(bid),
+				new PatternMatch("issue 'issue2' in bid has illegal value 3"));
 	}
 
@@ -152,5 +162,6 @@
 		// THREE is NOT a possible value in the NumberValueSet.
 		when(bid.getValue(ISSUE2)).thenReturn(new NumberValue(THREE));
-		assertThat(domain.isComplete(bid), new PatternMatch("Issues in bid .* do not match issues in domain .*"));
+		assertThat(domain.isComplete(bid), new PatternMatch(
+				"Issues in bid .* do not match issues in domain .*"));
 	}
 
@@ -165,3 +176,29 @@
 	}
 
+	@Test
+	public void testIsFittingPartialBid() {
+		Bid bid = new Bid(ISSUE1, I1V1);
+		assertNull(domain.isFitting(bid));
+	}
+
+	@Test
+	public void testIsFittingWrongTypeBid() {
+		Bid bid = new Bid(ISSUE1, I2V1);
+		assertThat(domain.isFitting(bid),
+				new PatternMatch("issue 'issue1' in bid has illegal value 2"));
+	}
+
+	@Test
+	public void testIsFittingNonsenseValue() {
+		Bid bid = new Bid(ISSUE1, new DiscreteValue("nonsense"));
+		assertThat(domain.isFitting(bid), new PatternMatch(
+				"issue 'issue1' in bid has illegal value \"nonsense\""));
+	}
+
+	@Test
+	public void testIsFittingNonsenseIssue() {
+		Bid bid = new Bid("nonsense", I1V1);
+		assertThat(domain.isFitting(bid), new PatternMatch(
+				"bid .* refers to non-domain issue 'nonsense'"));
+	}
 }
