package com.scg.util;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

/**
 * 
 * @author Brian Stamm
 */
public class AddressTest {
	
	private String streetNumber;
	private String city;
	private StateCode state;
	private String postalCode;
	private String testString;
	
	/**
	* Initialize all the variables for testing
	*/
	@Before
	public void initialize() {
		streetNumber = "416 Sid Snyder Avenue";
		city = "Olympia";
		state = StateCode.WA;
		postalCode = "98504";
		
		testString = String.format("%s%n%s, %s %s", streetNumber, city, state, postalCode);
		
	}

	@Test
	public void testConstructor() {
		Address testAddress = new Address(streetNumber, city, state, postalCode);
		assertEquals(testAddress.getStreetNumber(),streetNumber);
		assertEquals(testAddress.getCity(),city);
		assertEquals(testAddress.getState(),state);
		assertEquals(testAddress.getPostalCode(),postalCode);
	}
	
	@Test
	public void testToString() {
		Address testAddress = new Address(streetNumber, city, state, postalCode);
		assertEquals(testAddress.toString(),testString);
	}

}

@@ -107,17 +107,45 @@
 %0A/**%0A * 
+JUnit tests for Address.java
 %0A
-
  * @auth
@@ -192,16 +192,41 @@
 est %7B%0A%09%0A
+%09//variables for testing%0A
 %09private
@@ -646,15 +646,55 @@
 e);%0A
-%09%09%0A
 %09%7D%0A%0A
+%09/**%0A%09* Test the constructor & getters%0A%09*/%0A
 %09@Te
@@ -1014,18 +1014,55 @@
 de);%0A%09%7D%0A
-
 %09%0A
+%09/**%0A%09* Test the toString method%0A%09*/%0A
 %09@Test%0A%09

update comments