/********************************************************************
 * Copyright © 2004 VHA. All rights reserved
 ********************************************************************/
package gov.va.med.esr.messaging.builder.entity;

import gov.va.med.esr.common.builder.entity.DateBuilder;
import gov.va.med.esr.common.builder.entity.ReceivedEnrollmentBuilder;

// Java Classes

// Library Classes

// Framework Classes

// Common Classes
//import gov.va.med.esr.common.model.ee.ReceivedEnrollment;

/**
 * @author Martin Francisco
 */
public class ReceivedEnrollmentBuilderTest
    extends AbstractBuilderTestCase
{
    private ReceivedEnrollmentBuilder builder = null;

    private MockStringToObjectBuilder calculationSourceBuilder = null;
    private MockStringToObjectBuilder dataSourceBuilder = null;
    private MockStringToObjectBuilder priorityGroupBuilder = null;
    private MockStringToObjectBuilder prioritySubGroupBuilder = null;
    private MockStringToObjectBuilder statusBuilder = null;
    private MockStringToObjectBuilder vaFacilityBuilder = null;

    public ReceivedEnrollmentBuilderTest(String name)
    {
        super(name);

        this.builder = new ReceivedEnrollmentBuilder();
        this.builder.setDateBuilder(new DateBuilder());
    }

    /*
     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception
    {
        super.setUp();

        this.calculationSourceBuilder = new MockStringToObjectBuilder("1", 1);
        this.builder.setCalculationSourceBuilder(this.calculationSourceBuilder);

        this.dataSourceBuilder = new MockStringToObjectBuilder();
        this.builder.setDataSourceBuilder(this.dataSourceBuilder);

        this.priorityGroupBuilder = new MockStringToObjectBuilder("2", 1);
        this.builder.setPriorityGroupBuilder(this.priorityGroupBuilder);

        this.prioritySubGroupBuilder = new MockStringToObjectBuilder();
        this.builder.setPrioritySubGroupBuilder(this.prioritySubGroupBuilder);

        this.statusBuilder = new MockStringToObjectBuilder("1", 1);
        this.builder.setStatusBuilder(this.statusBuilder);

        this.vaFacilityBuilder = new MockStringToObjectBuilder("673", 1);
        this.builder.setVaFacilityBuilder(this.vaFacilityBuilder);
    }

    /*
     * @see TestCase#tearDown()
     */
    protected void tearDown() throws Exception
    {
        this.calculationSourceBuilder = null;
        this.builder.setCalculationSourceBuilder(null);

        this.dataSourceBuilder = null;
        this.builder.setDataSourceBuilder(null);

        this.priorityGroupBuilder = null;
        this.builder.setPriorityGroupBuilder(null);

        this.prioritySubGroupBuilder = null;
        this.builder.setPrioritySubGroupBuilder(null);

        this.statusBuilder = null;
        this.builder.setStatusBuilder(null);

        this.vaFacilityBuilder = null;
        this.builder.setVaFacilityBuilder(null);

        super.tearDown();
    }

    public void testBuild_Null_Existing() throws Exception
    {
        /*ReceivedEnrollment result = this.builder.build(null, super.getZEN());

        super.assertNotNull(result);
        super.assertEquals(super.getDateFormat().parse("20041115"), result
            .getEffectiveDate());
        super.assertNull(result.getEndDate());
        super.assertEquals(super.getDateFormat().parse("19980728"), result
            .getEnrollmentDate());
        super.assertNull(result.getOverrideFlag());

        super.assertTrue(this.calculationSourceBuilder
            .wasCalledWithExpectedValues());
        super.assertTrue(this.dataSourceBuilder.wasCalledWithExpectedValues());
        super.assertTrue(this.priorityGroupBuilder
            .wasCalledWithExpectedValues());
        super.assertTrue(this.prioritySubGroupBuilder
            .wasCalledWithExpectedValues());
        super.assertTrue(this.statusBuilder.wasCalledWithExpectedValues());
        super.assertTrue(this.vaFacilityBuilder.wasCalledWithExpectedValues());*/
    }
}