Пример #1
0
        public void Adhoc_Translate()
        {
            var transExp = Translator.CreateAdhocTranslation <TestPerson>()
                           .AddColumnConfiguration(x => x.PublicProperty)
                           .AddColumnConfiguration(x => x.PublicField);

            var rows = Translator.AdhocTranslate(transExp, people).Rows;

            Assert.AreEqual("Chris", rows[0][0]);
            Assert.AreEqual(100, (int)rows[0][1]);

            Assert.AreEqual("Aubrey", rows[1][0]);
            Assert.AreEqual(101, (int)rows[1][1]);

            Assert.AreEqual("John", rows[2][0]);
            Assert.AreEqual(102, (int)rows[2][1]);

            Assert.IsFalse(Translator.IsInitialized);
        }