private void checkRecursiveDefinition(TestRecursiveDefinetion decoded, TestRecursiveDefinetion standard) { Assert.AreEqual(decoded.Name, standard.Name); if (standard.Value != null) { Assert.IsNotNull(decoded.Value); checkRecursiveDefinition(decoded.Value, standard.Value); } }
public virtual TestRecursiveDefinetion createTestRecursiveDefinition() { TestRecursiveDefinetion result = new TestRecursiveDefinetion(); TestRecursiveDefinetion subResult = new TestRecursiveDefinetion(); result.Name = "aaaaa"; subResult.Name = "bbbbb"; result.Value = subResult; return(result); }
public virtual void testRecursiveDefinition() { IDecoder decoder = newDecoder(); System.IO.MemoryStream stream = new System.IO.MemoryStream((coderTestUtils.createTestRecursiveDefinitionBytes())); TestRecursiveDefinetion seq = decoder.decode <TestRecursiveDefinetion>(stream); Assert.IsNotNull(seq); checkRecursiveDefinition(seq, coderTestUtils.createTestRecursiveDefinition()); }