Skip to content

Instantly share code, notes, and snippets.

@starteleport
Created February 1, 2013 08:42
Show Gist options
  • Save starteleport/4690146 to your computer and use it in GitHub Desktop.
Save starteleport/4690146 to your computer and use it in GitHub Desktop.
VerificationException "Operation could destabilize the runtime." when mapping. Passing and failing tests
#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