public void InsertNewEventType_should_not_throw_exception_if_the_event_type_has_been_inserted_by_something_else()
{
Action changeAnotherUsersEmailInOtherAppDomain = () =>
{
AppDomainExtensions.ExecuteInCloneDomainScope(
() =>
{
var test = new SqlServerEventStoreSessionTests();
test.Setup();
using (var session = test.OpenSession(test.CreateStore()))
{
var otherUser = User.Register(session, "*****@*****.**", "password", Guid.NewGuid());
otherUser.ChangeEmail("*****@*****.**");
session.SaveChanges();
}
});
};
using (var session = OpenSession(CreateStore()))
{
var user = User.Register(session, "*****@*****.**", "password", Guid.NewGuid());
session.SaveChanges();
changeAnotherUsersEmailInOtherAppDomain();
user.ChangeEmail("*****@*****.**");
session.SaveChanges();
}
}