public void TestArray()
        {
            var message = new ArrayMessage <SpecificTransaction>
            {
                SpecificTrash = "st",
                Transactions  = new[]
                {
                    new SpecificTransaction {
                        SpecificTransactionTrash = "stt1"
                    },
                    new SpecificTransaction {
                        SpecificTransactionTrash = "stt2"
                    }
                }
            };

            writer.SerializeToString(message, true, Encoding.ASCII, true).AssertEqualsXml(@"
                <Message>
                    <specificTrash>st</specificTrash>
                    <SpecificTransaction>
                        <specifictransactiontrash>stt1</specifictransactiontrash>
                    </SpecificTransaction>
                    <SpecificTransaction>
                        <specifictransactiontrash>stt2</specifictransactiontrash>
                    </SpecificTransaction>
                </Message>");
        }
Exemple #2
0
        public void TestArray()
        {
            var message = new ArrayMessage <SpecificTransaction>
            {
                SpecificTrash = "st",
                Transactions  = new[]
                {
                    new SpecificTransaction {
                        SpecificTransactionTrash = "stt1"
                    },
                    new SpecificTransaction {
                        SpecificTransactionTrash = "stt2"
                    }
                }
            };

            var actual   = writer.SerializeToNameValueCollection(message, true);
            var expected = new NameValueCollection {
                { "specificTrash", "st" }, { "SpecificTransaction$0.specifictransactiontrash", "stt1" }, { "SpecificTransaction$1.specifictransactiontrash", "stt2" }
            };

            expected.AssertAreEqual(actual);
        }