-
Notifications
You must be signed in to change notification settings - Fork 748
SerializationException in low trust floating point equality test #2526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Explain what you mean about a low-trust AppDomain. Is it one you create yourself or the test domain created by NUnit? |
Ah, never mind, I see your test. As you know, Tolerance is never passed across a remoting boundary by NUNit. I see no harm in making it serializable, but if many more things like that should pop up I think we might want to rethink the strategy. |
I'm a bit confused why Tolerance needs to be marked as Serializable, and nothing else. Does someone mind explaining what's going on here? My thinking is I want to understand this to catch in future code reviews, but I'm not sure a) What's required to be marked as Serializable, and b) What NUnit supports running in low-trust. |
Actually @ggeurts pretty much added all this functionality, which I didn't know we had! I'm guessing that it's a matter of passing back the Constraint Result and it's contents. |
I added the functionality (and the LowTrustFixture) to get some NUnit 2 tests running again that verify that code was able to run within partial trust environments. This was done by running the code to be tested and the assertions in a separate appdomain with a reduced permission set. In NUnit 3 some constraint outcomes could indeed not be serialized across AppDomain boundaries, causing tests to fail. |
Issue #2526 - Fix Tolerance SerializationException in low-trust tests
The following test throws when run in low trust appdomain:
System.Runtime.Serialization.SerializationException : Type 'NUnit.Framework.Constraints.Tolerance' in Assembly 'nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' is not marked as serializable.
The text was updated successfully, but these errors were encountered: