Exemple #1
0
        public void GenericPocosCanRoundTrip()
        {
            var original = new GenericPoco <string>
            {
                ArrayField = new[] { "a", "bb", "ccc" },
                Field      = Guid.NewGuid().ToString("N")
            };
            var result = (GenericPoco <string>) this.RoundTripThroughUntypedSerializer(original);

            Assert.Equal(original.ArrayField, result.ArrayField);
            Assert.Equal(original.Field, result.Field);
        }
Exemple #2
0
        public void GenericPocosCanRoundTrip()
        {
            var original = new GenericPoco <string>
            {
                ArrayField = new[] { "a", "bb", "ccc" },
                Field      = Guid.NewGuid().ToString("N")
            };
            var result = (GenericPoco <string>)RoundTripThroughUntypedSerializer(original, out var formattedBitStream);

            Assert.Equal(original.ArrayField, result.ArrayField);
            Assert.Equal(original.Field, result.Field);
            Assert.Contains("gpoco`1", formattedBitStream);
        }
Exemple #3
0
        public void NestedGenericPocoWithTypeAlias()
        {
            var original = new GenericPoco <GenericPoco <string> >
            {
                Field = new GenericPoco <string>
                {
                    Field = Guid.NewGuid().ToString("N")
                }
            };

            RoundTripThroughUntypedSerializer(original, out var formattedBitStream);
            Assert.Contains("gpoco`1[[gpoco`1[[string]]]]", formattedBitStream);
        }