BendTests.A01_RecordTests.T02b_RecordKeyNesting C# (CSharp) Method

T02b_RecordKeyNesting() private method

private T02b_RecordKeyNesting ( ) : void
return void
        public void T02b_RecordKeyNesting()
        {
            String[] parts1 = { "aaaa", "bbbb" };
            String[] parts2 = { "xxxx", "yyyy", "zzzz" };

            RecordKey nestedkey = new RecordKey();
            nestedkey.appendKeyParts(parts2);

            RecordKey parentkey = new RecordKey();
            parentkey.appendKeyPart(parts1[0]); // "aaaa"
            parentkey.appendKeyPart(nestedkey.encode());  // (xxxx,yyyy,zzzz)
            parentkey.appendKeyPart(parts1[1]); // "bbbb"

            RecordKey decodedkey = new RecordKey(parentkey.encode());

            Assert.AreEqual(decodedkey.ToString(), parentkey.ToString(), "tostring versions of keys don't match");
            Assert.AreEqual(decodedkey.numParts(), parentkey.numParts(), "nested delimiters are changing number of keyparts");

            Assert.AreEqual(decodedkey, parentkey, "nested key encode/decode error");
        }