/**
 * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
 * 
 * Please see distribution for license.
 */
package com.opengamma.engine.fudgemsg;

import org.testng.annotations.Test;
import com.opengamma.engine.value.ValueProperties;
import com.opengamma.util.test.AbstractBuilderTestCase;

/**
 * Test the {@link ValuePropertiesBuilder} class.
 */
@Test
public class ValuePropertiesBuilderTest extends AbstractBuilderTestCase {

  public void testEmptyProperties() {
    assertEncodeDecodeCycle(ValueProperties.class, ValueProperties.none());
  }

  public void testAllProperties() {
    assertEncodeDecodeCycle(ValueProperties.class, ValueProperties.all());
  }
  
  public void testNearlyAllProperties() {//PLAT-1126
    assertEncodeDecodeCycle(ValueProperties.class, ValueProperties.all().withoutAny("SomeProp"));
  }

  public void testValues() {
    assertEncodeDecodeCycle(ValueProperties.class, ValueProperties.builder().withAny("Any").with("One", "a").with("Two", "b", "c").withOptional("Three").get());
  }

}

@@ -1043,10 +1043,204 @@
 );%0A  %7D%0A%0A
+  public void testOptionalValues() %7B%0A    assertEncodeDecodeCycle(ValueProperties.class, ValueProperties.builder().withOptional(%22OptAny%22).withOptional(%22OptSome%22).with(%22OptSome%22, %22a%22).get());%0A  %7D%0A
 %7D%0A

Test optional with values