You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assert.That( typeHeader.IsTypeOf<string>, Is.True, typeHeader.ToString() ); // known type header
19350
+
Assert.That( typeHeader.IsTypeOf<string>().GetValueOrDefault(), Is.True, typeHeader.ToString() ); // known type header
19335
19351
// Verify override in member value.
19336
19352
Assert.That( typeHeader.AsString(), Is.EqualTo( "A" ), typeHeader.ToString() );
19337
19353
}
@@ -19460,7 +19476,11 @@ public void TestRuntimeTypeDictionary_AttributeIsKnown_Field_Known_Fail()
19460
19476
using ( var buffer = new MemoryStream() )
19461
19477
{
19462
19478
var ex = Assert.Catch<SerializationException>( () => serializer.Pack( buffer ,target ) );
19479
+
#if !UNITY && !XAMARIN
19463
19480
Assert.That( ex.Message, Does.Contain( "is not defined as known type" ) );
19481
+
#else
19482
+
Assert.That( ex.Message.Contains( "is not defined as known type" ), ex.Message );
19483
+
#endif // !UNITY && !XAMARIN
19464
19484
}
19465
19485
}
19466
19486
@@ -19479,7 +19499,11 @@ public void TestRuntimeTypeDictionary_AttributeIsKnown_Property_Known_Fail()
19479
19499
using ( var buffer = new MemoryStream() )
19480
19500
{
19481
19501
var ex = Assert.Catch<SerializationException>( () => serializer.Pack( buffer ,target ) );
19502
+
#if !UNITY && !XAMARIN
19482
19503
Assert.That( ex.Message, Does.Contain( "is not defined as known type" ) );
19504
+
#else
19505
+
Assert.That( ex.Message.Contains( "is not defined as known type" ), ex.Message );
19506
+
#endif // !UNITY && !XAMARIN
19483
19507
}
19484
19508
}
19485
19509
@@ -19702,7 +19726,11 @@ public void TestSpecifiedTypeVerifierIsNotFound_BecauseNoMethods_Fail()
19702
19726
var target = new RuntimeTypePolymorphicWithInvalidVerifierNoMethods { Value = "Foo" };
19703
19727
19704
19728
var ex = Assert.Catch<SerializationException>( () => context.GetSerializer<RuntimeTypePolymorphicWithInvalidVerifierNoMethods>() );
19729
+
#if !UNITY && !XAMARIN
19705
19730
Assert.That( ex.Message, Does.StartWith( "VerifierMethodName cannot be null " ).Or.StartWith( "A public static or instance method " ) );
19731
+
#else
19732
+
Assert.That( ex.Message.StartsWith( "VerifierMethodName cannot be null " ) || ex.Message.StartsWith( "A public static or instance method " ), ex.Message );
19733
+
#endif // !UNITY && !XAMARIN
19706
19734
}
19707
19735
19708
19736
[Test]
@@ -19713,7 +19741,11 @@ public void TestSpecifiedTypeVerifierIsNotFound_BecauseVoidReturnMethod_Fail()
19713
19741
var target = new RuntimeTypePolymorphicWithInvalidVerifierVoidReturnMethod { Value = "Foo" };
19714
19742
19715
19743
var ex = Assert.Catch<SerializationException>( () => context.GetSerializer<RuntimeTypePolymorphicWithInvalidVerifierVoidReturnMethod>() );
19744
+
#if !UNITY && !XAMARIN
19716
19745
Assert.That( ex.Message, Does.StartWith( "VerifierMethodName cannot be null " ).Or.StartWith( "A public static or instance method " ) );
19746
+
#else
19747
+
Assert.That( ex.Message.StartsWith( "VerifierMethodName cannot be null " ) || ex.Message.StartsWith( "A public static or instance method " ), ex.Message );
19748
+
#endif // !UNITY && !XAMARIN
19717
19749
}
19718
19750
19719
19751
[Test]
@@ -19724,7 +19756,11 @@ public void TestSpecifiedTypeVerifierIsNotFound_BecauseNoParametersMethod_Fail()
19724
19756
var target = new RuntimeTypePolymorphicWithInvalidVerifierNoParametersMethod { Value = "Foo" };
19725
19757
19726
19758
var ex = Assert.Catch<SerializationException>( () => context.GetSerializer<RuntimeTypePolymorphicWithInvalidVerifierNoParametersMethod>() );
19759
+
#if !UNITY && !XAMARIN
19727
19760
Assert.That( ex.Message, Does.StartWith( "VerifierMethodName cannot be null " ).Or.StartWith( "A public static or instance method " ) );
19761
+
#else
19762
+
Assert.That( ex.Message.StartsWith( "VerifierMethodName cannot be null " ) || ex.Message.StartsWith( "A public static or instance method " ), ex.Message );
19763
+
#endif // !UNITY && !XAMARIN
19728
19764
}
19729
19765
19730
19766
[Test]
@@ -19735,7 +19771,11 @@ public void TestSpecifiedTypeVerifierIsNotFound_BecauseExtraParametersMethod_Fai
19735
19771
var target = new RuntimeTypePolymorphicWithInvalidVerifierExtraParametersMethod { Value = "Foo" };
19736
19772
19737
19773
var ex = Assert.Catch<SerializationException>( () => context.GetSerializer<RuntimeTypePolymorphicWithInvalidVerifierExtraParametersMethod>() );
19774
+
#if !UNITY && !XAMARIN
19738
19775
Assert.That( ex.Message, Does.StartWith( "VerifierMethodName cannot be null " ).Or.StartWith( "A public static or instance method " ) );
19776
+
#else
19777
+
Assert.That( ex.Message.StartsWith( "VerifierMethodName cannot be null " ) || ex.Message.StartsWith( "A public static or instance method " ), ex.Message );
19778
+
#endif // !UNITY && !XAMARIN
19739
19779
}
19740
19780
19741
19781
[Test]
@@ -19753,7 +19793,11 @@ public void TestTypeVerifierDoesNotLoadTypeItself()
19753
19793
packer.PackString( "Foo" ); // Value
19754
19794
buffer.Position = 0;
19755
19795
var ex = Assert.Catch<SerializationException>( () => serializer.Unpack( buffer ) );
19796
+
#if !UNITY && !XAMARIN
19756
19797
Assert.That( ex.Message, Does.StartWith( "Type verifier rejects type " ) );
19798
+
#else
19799
+
Assert.That( ex.Message.StartsWith( "Type verifier rejects type " ), ex.Message );
0 commit comments