public SagaStorageTests()
 {
     _host = Substitute.For <IConfigureHost>();
     _cfg  = new StoragesConfiguration(_host, Setup.GetConnection());
     _cfg.EnableSagaStorage(ifExists: TableExistsAction.DropIt);
     _sut = new SagaStorage(Setup.GetConnection());
 }
        /// <summary>构造函数</summary>
        public StorageNodeProvider()
        {
            this.configuration = StoragesConfigurationView.Instance.Configuration;

            this.ibatisMapping = this.configuration.Keys["IBatisMapping"].Value;

            this.ibatisMapper = ISqlMapHelper.CreateSqlMapper(this.ibatisMapping, true);
        }
Beispiel #3
0
        public ProcessingStorageTests()
        {
            _host = Substitute.For <IConfigureHost>();

            _host.WithProcessingStorage(Arg.Do <IStoreUnhandledMessages>(v => _sut = v));
            _cfg = new StoragesConfiguration(_host, Setup.GetConnection());
            _cfg.EnableProcessorStorage(ifExists: TableExistsAction.DropIt);
        }
Beispiel #4
0
        public void TestInit()
        {
            StoragesConfiguration configuration = StoragesConfigurationView.Instance.Configuration;

            Assert.IsNotNull(configuration);

            Assert.IsNotNull(configuration.Keys["SpringObjectFile"]);
            Assert.IsNotNull(configuration.Keys["IBatisMapping"]);
        }
Beispiel #5
0
        // [DeploymentItem("MySql.Data.dll")]
        public void TestCreateMapper()
        {
            StoragesConfiguration configuration = StoragesConfigurationView.Instance.Configuration;

            string ibatisMapping = configuration.Keys["IBatisMapping"].Value;

            Console.WriteLine(ibatisMapping);

            ISqlMapper ibatisMapper = ISqlMapHelper.CreateSqlMapper(ibatisMapping, true);

            Assert.IsNotNull(ibatisMapper);
        }
        /// <summary>构造函数</summary>
        public StorageSchemaService()
        {
            this.configuration = StoragesConfigurationView.Instance.Configuration;

            // 创建对象构建器(Spring.NET)
            string springObjectFile = this.configuration.Keys["SpringObjectFile"].Value;

            SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(StoragesConfiguration.ApplicationName, springObjectFile);

            // 创建数据提供器
            this.provider = objectBuilder.GetObject <IStorageSchemaProvider>(typeof(IStorageSchemaProvider));
        }
Beispiel #7
0
        public ReserveIdStorageTests()
        {
            _host = Substitute.For <IConfigureHost>();

            _host.WithReserveIdStorage(Arg.Do <IStoreReservedMessagesIds>(v => _sut = v));
            _cfg = new StoragesConfiguration(_host, Setup.GetConnection());
            _cfg.EnableReserveIdStorage(ifExists: TableExistsAction.DropIt);

            _src = new ReservedIdsSource()
            {
                Count       = 2,
                HandlerType = GetType(),
                MessageId   = Guid.Empty
            };
        }