public void testEncodeChoiceInChoice() { IEncoder encoder = newEncoder(); Assert.NotNull(encoder); printEncoded("EncodeChoiceInChoice: ", encoder, coderTestUtils.createChoiceInChoice()); checkEncoded(encoder, coderTestUtils.createChoiceInChoice(), coderTestUtils.createChoiceInChoiceBytes()); }
public void testDecodeChoiceInChoice() { IDecoder decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream(coderTestUtils.createChoiceInChoiceBytes()); BugValueType val = decoder.decode <BugValueType>(stream); Assert.Equals(val.isBugPrimitiveSelected(), coderTestUtils.createChoiceInChoice().isBugPrimitiveSelected()); Assert.Equals(val.BugPrimitive.isBugIntegerSelected(), coderTestUtils.createChoiceInChoice().BugPrimitive.isBugIntegerSelected()); Assert.Equals(val.BugPrimitive.BugInteger, coderTestUtils.createChoiceInChoice().BugPrimitive.BugInteger); }