public void FailToConvertNonSerializableItems()
        {
            NonSerializableTestObject testObject = new NonSerializableTestObject { 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], "\\Non serializable type :(\\");
            Assert.Equal(columns[2], typeof(NonSerializableTestObject));
        }
Exemple #2
0
        public void FailToConvertNonSerializableItems()
        {
            NonSerializableTestObject testObject = new NonSerializableTestObject {
                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], "\\Non serializable type :(\\");
            Assert.Equal(columns[2], typeof(NonSerializableTestObject));
        }