CQRS.Tests.CQRS.EventSourcing.Sql.SqlServerEventStoreSessionTests.InsertNewEventType_should_not_throw_exception_if_the_event_type_has_been_inserted_by_something_else C# (CSharp) Method

InsertNewEventType_should_not_throw_exception_if_the_event_type_has_been_inserted_by_something_else() private method

        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, "[email protected]", "password", Guid.NewGuid());
                                                                          otherUser.ChangeEmail("[email protected]");
                                                                          session.SaveChanges();
                                                                      }
                                                                  });
                                                           };

            using (var session = OpenSession(CreateStore()))
            {
                var user = User.Register(session, "[email protected]", "password", Guid.NewGuid());
                session.SaveChanges();

                changeAnotherUsersEmailInOtherAppDomain();

                user.ChangeEmail("[email protected]");
                session.SaveChanges();
            }
        }
    }