예제 #1
0
        public void CanConvertObjectWithNullFieldToArrays()
        {
            var obj = new { x = 1254, y = (object)null, z = (string)null };

            var arrays = TransformationProvider.ConvertObjectToArrays(obj);

            Assert.AreEqual(new[] { "x", "y", "z" }, arrays.Item1);
            Assert.AreEqual(new[] { "1254", null, null }, arrays.Item2);
        }
예제 #2
0
        public void CanConvertObjectWithIndexedFieldToArrays()
        {
            var obj = new Gwelkghlw {
                Id = 1254
            };

            obj[12] = "qewgfwgewrgh";
            obj[13] = "eljpowwdoihgvwoihio";

            var arrays = TransformationProvider.ConvertObjectToArrays(obj);

            Assert.AreEqual(new[] { "Id" }, arrays.Item1);
            Assert.AreEqual(new[] { "1254" }, arrays.Item2);
        }
예제 #3
0
        public void CanConvertNullObjectToArrays()
        {
            var arrays = TransformationProvider.ConvertObjectToArrays(null);

            Assert.IsNull(arrays);
        }