package com.coltsoftware.liquidsledgehammer.model;

import static org.junit.Assert.*;

import org.junit.Test;

import com.coltsoftware.liquidsledgehammer.MoneyTestBase;

public final class MoneyFormattingTests extends MoneyTestBase {

	@Test
	public void can_format_money_as_string() {
		assertEquals(" 1.23", gbp(123).toString());
	}

	@Test
	public void can_format_negative_money_as_string() {
		assertEquals("- 1.23", gbp(-123).toString());
	}

	@Test
	public void can_format_money_with_no_penny_as_string() {
		assertEquals(" 1.00", gbp(100).toString());
	}

	@Test
	public void can_format_us_money_as_string() {
		assertEquals("USD 8.34", usd(834).toString());
	}

	@Test
	public void can_format_euro_money_as_string() {
		assertEquals(" 8.34", euro(834).toString());
	}

	@Test
	public void can_format_negative_euro_money_as_string() {
		assertEquals("- 0.34", euro(-34).toString());
	}

	@Test
	public void can_format_yen_money_as_string_respecting_no_fraction() {
		assertEquals("JPY 234", yen(234).toString());
	}

	@Test
	public void can_format_gbp_money_without_symbol() {
		assertEquals("1.34", gbp(134).toStringNoSymbol());
	}

	@Test
	public void can_format_negative_euro_money_without_symbol() {
		assertEquals("-0.34", euro(-34).toStringNoSymbol());
	}

	@Test
	public void can_format_large_value_gbp_money_with_thousand_seperators() {
		assertEquals(" 1,340.00", gbp(134000).toString());
	}

	@Test
	public void can_format_large_value_gbp_money_without_thousand_seperators() {
		assertEquals("1340.00", gbp(134000).toStringNoSymbol());
	}

}

@@ -295,16 +295,17 @@
 Equals(%22
+%C2%A3
  1.23%22, 
@@ -318,32 +318,32 @@
 3).toString());%0A
-
 %09%7D%0A%0A%09@Test%0A%09publ
@@ -407,16 +407,17 @@
 quals(%22-
+%C2%A3
  1.23%22, 
@@ -524,16 +524,17 @@
 Equals(%22
+%C2%A3
  1.00%22, 
@@ -738,16 +738,17 @@
 Equals(%22
+%E2%82%AC
  8.34%22, 
@@ -856,16 +856,17 @@
 quals(%22-
+%E2%82%AC
  0.34%22, 
@@ -1342,32 +1342,32 @@
 _seperators() %7B%0A
-
 %09%09assertEquals(%22
@@ -1366,16 +1366,17 @@
 Equals(%22
+%C2%A3
  1,340.0

Fix test by converting to UTF-8