Avoid non documented exceptions in BinaryFormatter.Deserialize (dotnet/corefx#40215)
authorbirkmose <michael.birkmose@gmail.com>
Tue, 8 Oct 2019 16:07:03 +0000 (18:07 +0200)
committerViktor Hofer <viktor.hofer@microsoft.com>
Tue, 8 Oct 2019 16:07:03 +0000 (18:07 +0200)
commitab3f09587f51022f40bff940df34035e7f05b871
tree1c19dec031204848b98c73c5e10de663ffd6d59c
parente63b895c1fa93848b2f696558d3a75f02fd7a67d
Avoid non documented exceptions in BinaryFormatter.Deserialize (dotnet/corefx#40215)

* dotnet/corefx#35491 Fixes issue with BinaryFormatter.Deserialize throwing other exceptions than those specified in the documentation (only supposed to throw SerializationException or SecurityException).

* Update UnitySerializationHolderTests to test the expected behaviour of BinaryFormatter.Deserialize. Fix naming error in SerializationGuardTests.

Commit migrated from https://github.com/dotnet/corefx/commit/1736bfa5f06d4d3a60742142f0aaf601bd4db788
src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryFormatter.cs
src/libraries/System.Runtime.Serialization.Formatters/tests/SerializationGuardTests.cs
src/libraries/System.Runtime/tests/System/UnitySerializationHolderTests.cs