package com.finance.datamodel;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import org.junit.Test;

public class PercentageTest {

	@Test
	public void testPercentageAsValue() {
		final Percentage percentage = new Percentage(100, 200);

		assertThat(percentage.asValue(), is(50D));
	}

	@Test
	public void testPercentageAsFactor() {
		final Percentage percentage = new Percentage(100, 200);

		assertThat(percentage.asFactor(), is(0.50));

	}

}

@@ -426,34 +426,33 @@
  new Percentage(
-10
+5
 0, 200);%0D%0A%0D%0A%09%09as
@@ -488,18 +488,18 @@
 ), is(0.
+2
 5
-0
 ));%0D%0A%0D%0A%09

Test for Percentage