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

Setup() private method

private Setup ( ) : void
return void
        public void Setup()
        {

            var masterConnectionString = ConfigurationManager.ConnectionStrings["MasterDb"].ConnectionString;
            _temporaryLocalDbManager = new TemporaryLocalDbManager(masterConnectionString);
            ConnectionString = _temporaryLocalDbManager.CreateOrGetLocalDb($"SqlServerEventStoreSessionTests_EventStore");
        }

Usage Example

コード例 #1
0
        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();
            }
        }
All Usage Examples Of CQRS.Tests.CQRS.EventSourcing.Sql.SqlServerEventStoreSessionTests::Setup