private static void TestDataContractAndNonSerializableAreMixedCore(SerializationMethod method)
        {
            var context = new SerializationContext()
            {
                SerializationMethod = method
            };

            using (var buffer = new MemoryStream())
            {
                var target = new DataContractAndNonSerializedMixedTarget();
                target.ShouldSerialized = 111;
                var serializer = MessagePackSerializer.Create <DataContractAndNonSerializedMixedTarget>(context);
                serializer.Pack(buffer, target);

                buffer.Position = 0;
                var intermediate = Unpacking.UnpackObject(buffer);

                if (method == SerializationMethod.Array)
                {
                    var asArray = intermediate.AsList();
                    Assert.That(asArray.Count, Is.EqualTo(1));
                    Assert.That(asArray[0] == target.ShouldSerialized);
                }
                else
                {
                    var asMap = intermediate.AsDictionary();
                    Assert.That(asMap.Count, Is.EqualTo(1));
                    Assert.That(asMap["ShouldSerialized"] == target.ShouldSerialized);
                }

                buffer.Position = 0;

                var result = serializer.Unpack(buffer);

                Assert.That(result.ShouldSerialized, Is.EqualTo(target.ShouldSerialized));
            }
        }
		private static void TestDataContractAndNonSerializableAreMixedCore( SerializationMethod method )
		{
			var context = new SerializationContext() { SerializationMethod = method };

			using ( var buffer = new MemoryStream() )
			{
				var target = new DataContractAndNonSerializedMixedTarget();
				target.ShouldSerialized = 111;
				var serializer = MessagePackSerializer.Create<DataContractAndNonSerializedMixedTarget>( context );
				serializer.Pack( buffer, target );

				buffer.Position = 0;
				var intermediate = Unpacking.UnpackObject( buffer );

				if ( method == SerializationMethod.Array )
				{
					var asArray = intermediate.AsList();
					Assert.That( asArray.Count, Is.EqualTo( 1 ) );
					Assert.That( asArray[ 0 ] == target.ShouldSerialized );
				}
				else
				{
					var asMap = intermediate.AsDictionary();
					Assert.That( asMap.Count, Is.EqualTo( 1 ) );
					Assert.That( asMap[ "ShouldSerialized" ] == target.ShouldSerialized );
				}

				buffer.Position = 0;

				var result = serializer.Unpack( buffer );

				Assert.That( result.ShouldSerialized, Is.EqualTo( target.ShouldSerialized ) );
			}
		}