Created
February 1, 2013 08:42
-
-
Save starteleport/4690146 to your computer and use it in GitHub Desktop.
VerificationException "Operation could destabilize the runtime." when mapping. Passing and failing tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Types for VerificationFailedExceptionTest | |
public class Class1 | |
{ | |
public string Token { get; set; } | |
} | |
public class Class2 | |
{ | |
private readonly string _token; | |
[MapField(Storage = "_token")] | |
public string Token | |
{ | |
get { return _token; } | |
} | |
} | |
public class Class3 | |
{ | |
private string _token; | |
[MapField(Storage = "_token")] | |
public string Token | |
{ | |
get { return _token; } | |
} | |
} | |
#endregion | |
[TestMethod] | |
public void VerificationFailedExceptionTest_Fails() | |
{ | |
var ormToDomain = Map.GetObjectMapper<Class1, Class2>(); | |
Class1 record = new Class1 { Token = "test" }; | |
ormToDomain(record); | |
} | |
[TestMethod] | |
public void VerificationFailedExceptionTest_Passes() | |
{ | |
var ormToDomain = Map.GetObjectMapper<Class1, Class3>(); | |
Class1 record = new Class1 { Token = "test" }; | |
ormToDomain(record); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment