public void SimpleGenericBondSchemaCopyTest()
        {
            var schema = new SimpleGenericSchema <int> {
                SomeValue = int.MaxValue
            };
            var output = this.environment.SerializationManager.DeepCopy(schema) as SimpleGenericSchema <int>;

            Assert.NotSame(output, schema);                   //The serializer returned an instance of the same object
            Assert.Equal(schema.SomeValue, output.SomeValue); //The serialization didn't preserve the proper value
        }
예제 #2
0
        public void SimpleGenericBondSchemaSerializationTest()
        {
            var schema = new SimpleGenericSchema <int> {
                SomeValue = int.MaxValue
            };
            var output = SerializationManager.RoundTripSerializationForTesting(schema);

            Assert.NotSame(output, schema);                   //The serializer returned an instance of the same object
            Assert.Equal(schema.SomeValue, output.SomeValue); //The serialization didn't preserve the proper value
        }
예제 #3
0
        public void SimpleNestedGenericBondSchemaCopyTest()
        {
            var schema = new SimpleGenericSchema <SimpleGenericSchema <SimpleBondSchema> >
            {
                SomeValue = new SimpleGenericSchema <SimpleBondSchema>
                {
                    SomeValue = new SimpleBondSchema
                    {
                        SomeValue = int.MaxValue
                    }
                }
            };

            var output = SerializationManager.DeepCopy(schema) as SimpleGenericSchema <SimpleGenericSchema <SimpleBondSchema> >;

            Assert.NotNull(output);
            Assert.NotSame(output, schema);                                                           //The serializer returned an instance of the same object
            Assert.Equal(schema.SomeValue.SomeValue.SomeValue, output.SomeValue.SomeValue.SomeValue); //The serialization didn't preserve the proper value
        }
예제 #4
0
        public void SimpleNestedGenericBondSchemaSerializationTest()
        {
            var schema = new SimpleGenericSchema <SimpleGenericSchema <SimpleBondSchema> >
            {
                SomeValue = new SimpleGenericSchema <SimpleBondSchema>
                {
                    SomeValue = new SimpleBondSchema
                    {
                        SomeValue = int.MaxValue
                    }
                }
            };

            var output = SerializationManager.RoundTripSerializationForTesting(schema);

            Assert.IsNotNull(output);
            Assert.AreNotSame(output, schema, "The serializer returned an instance of the same object");
            Assert.AreEqual(schema.SomeValue.SomeValue.SomeValue, output.SomeValue.SomeValue.SomeValue, "The serialization didn't preserve the proper value");
        }