コード例 #1
0
        public void CanSerializeNullElements()
        {
            var message = new MessageWithEnumerableOfString
                {
                    SomeStrings = new[]
                        {
                            "element 1",
                            null,
                            null,
                           "element 2"
                        }
                };

            var result = ExecuteSerializer.ForMessage<MessageWithEnumerableOfString>(message);
            Assert.IsNotNull(result.SomeStrings);
            Assert.AreEqual(4, result.SomeStrings.Count());
        }
コード例 #2
0
        public void CanSerializeNullElements()
        {
            var message = new MessageWithEnumerableOfString
            {
                SomeStrings = new[]
                {
                    "element 1",
                    null,
                    null,
                    "element 2"
                }
            };

            var result = ExecuteSerializer.ForMessage <MessageWithEnumerableOfString>(message);

            Assert.IsNotNull(result.SomeStrings);
            Assert.AreEqual(4, result.SomeStrings.Count());
        }