Esempio n. 1
0
        public void CreateTransactionStrategy_WithoutParentFunction_And_WithoutParentTransaction()
        {
            WxeContextFactory wxeContextFactory = new WxeContextFactory();
            WxeContext        context           = wxeContextFactory.CreateContext(new TestFunction());

            ITransactionMode        transactionMode = new CreateChildIfParentTransactionMode(true, new TestTransactionFactory());
            TransactionStrategyBase strategy        = transactionMode.CreateTransactionStrategy(new TestFunction2(transactionMode), context);

            Assert.That(strategy, Is.InstanceOf(typeof(RootTransactionStrategy)));
            Assert.That(strategy.GetNativeTransaction <TestTransaction>(), Is.InstanceOf(typeof(TestTransaction)));
            Assert.That(((RootTransactionStrategy)strategy).AutoCommit, Is.True);
            Assert.That(((RootTransactionStrategy)strategy).Transaction, Is.InstanceOf(typeof(TestTransaction)));
            Assert.That(strategy.OuterTransactionStrategy, Is.InstanceOf(typeof(NullTransactionStrategy)));
        }
 public void GetNativeTransaction()
 {
     Assert.That(_strategy.GetNativeTransaction <ITransaction>(), Is.Null);
 }