public void ConvertSerializableItems()
        {
            SerializableTestObject testObject = new SerializableTestObject { TestProperty = "Test Value" };

            List<SessionModel> sessionModels = new List<SessionModel>
                {
                    new SessionModel
                        {
                            Key = "Key1",
                            Value = testObject,
                            Type = testObject.GetType()
                        }
                };

            object rows = new SessionModelConverter().Convert(sessionModels);
            List<object> columns = GetFirstValueRowFromConvertedSessionModel(rows);

            Assert.Equal(columns[0], "Key1");
            Assert.Equal(columns[1], testObject);
            Assert.Equal(columns[2], typeof(SerializableTestObject));
        }
示例#2
0
        public void ConvertSerializableItems()
        {
            SerializableTestObject testObject = new SerializableTestObject {
                TestProperty = "Test Value"
            };

            List <SessionModel> sessionModels = new List <SessionModel>
            {
                new SessionModel
                {
                    Key   = "Key1",
                    Value = testObject,
                    Type  = testObject.GetType()
                }
            };

            object        rows    = new SessionModelConverter().Convert(sessionModels);
            List <object> columns = GetFirstValueRowFromConvertedSessionModel(rows);

            Assert.Equal(columns[0], "Key1");
            Assert.Equal(columns[1], testObject);
            Assert.Equal(columns[2], typeof(SerializableTestObject));
        }