Exemplo n.º 1
0
        public void TxnMgr()
        {
            TransactionTemplate temp = new TransactionTemplate();

            temp.PlatformTransactionManager = A.Fake <IPlatformTransactionManager>();
            temp.AfterPropertiesSet();
        }
Exemplo n.º 2
0
        public void TxnMgr()
        {
            TransactionTemplate temp = new TransactionTemplate();

            temp.PlatformTransactionManager = MockRepository.GenerateMock <IPlatformTransactionManager>();
            temp.AfterPropertiesSet();
        }
        public void TxnMgr()
        {
            TransactionTemplate temp = new TransactionTemplate();

            temp.PlatformTransactionManager = new MockTxnPlatformMgr();
            temp.AfterPropertiesSet();
        }
Exemplo n.º 4
0
		public void NullResult()
		{
			MockTxnPlatformMgr mock = new MockTxnPlatformMgr();
			mock.SetExpectedGetTxnCallCount(1);
			mock.SetExpectedCommitCallCount(1);
			TransactionTemplate temp = new TransactionTemplate(mock);
			temp.AfterPropertiesSet();
			Assert.AreEqual( mock, temp.PlatformTransactionManager);
			Assert.IsNull( temp.Execute(new TransactionDelegate(DummyTransactionMethod) ) );
			mock.Verify();
		}
        public void NullResult()
        {
            IPlatformTransactionManager mock = MockRepository.GenerateMock<IPlatformTransactionManager>();

            TransactionTemplate temp = new TransactionTemplate(mock);
            temp.AfterPropertiesSet();
            Assert.AreEqual(mock, temp.PlatformTransactionManager);
            Assert.IsNull(temp.Execute(new TransactionDelegate(DummyTransactionMethod)));

            mock.AssertWasCalled(x => x.GetTransaction(Arg<ITransactionDefinition>.Is.Anything), constraints => constraints.Repeat.Once());
            mock.AssertWasCalled(x => x.Commit(Arg<ITransactionStatus>.Is.Anything), constraints => constraints.Repeat.Once());
        }
Exemplo n.º 6
0
        public void NullResult()
        {
            IPlatformTransactionManager mock = MockRepository.GenerateMock <IPlatformTransactionManager>();

            TransactionTemplate temp = new TransactionTemplate(mock);

            temp.AfterPropertiesSet();
            Assert.AreEqual(mock, temp.PlatformTransactionManager);
            Assert.IsNull(temp.Execute(new TransactionDelegate(DummyTransactionMethod)));

            mock.AssertWasCalled(x => x.GetTransaction(Arg <ITransactionDefinition> .Is.Anything), constraints => constraints.Repeat.Once());
            mock.AssertWasCalled(x => x.Commit(Arg <ITransactionStatus> .Is.Anything), constraints => constraints.Repeat.Once());
        }
        public void NullResult()
        {
            MockTxnPlatformMgr mock = new MockTxnPlatformMgr();

            mock.SetExpectedGetTxnCallCount(1);
            mock.SetExpectedCommitCallCount(1);
            TransactionTemplate temp = new TransactionTemplate(mock);

            temp.AfterPropertiesSet();
            Assert.AreEqual(mock, temp.PlatformTransactionManager);
            Assert.IsNull(temp.Execute(new TransactionDelegate(DummyTransactionMethod)));
            mock.Verify();
        }
Exemplo n.º 8
0
        public void NullResult()
        {
            IPlatformTransactionManager mock = A.Fake <IPlatformTransactionManager>();

            A.CallTo(() => mock.GetTransaction(A <ITransactionDefinition> ._)).Returns(null);

            TransactionTemplate temp = new TransactionTemplate(mock);

            temp.AfterPropertiesSet();
            Assert.AreEqual(mock, temp.PlatformTransactionManager);
            Assert.IsNull(temp.Execute(DummyTransactionMethod));

            A.CallTo(() => mock.GetTransaction(A <ITransactionDefinition> ._)).MustHaveHappenedOnceExactly();
            A.CallTo(() => mock.Commit(A <ITransactionStatus> ._)).MustHaveHappenedOnceExactly();
        }
Exemplo n.º 9
0
        public void NoTxnMgr()
        {
            TransactionTemplate temp = new TransactionTemplate();

            Assert.Throws <ArgumentException>(() => temp.AfterPropertiesSet());
        }
        public void NoTxnMgr()
        {
            TransactionTemplate temp = new TransactionTemplate();

            temp.AfterPropertiesSet();
        }
Exemplo n.º 11
0
			public void TxnMgr()
		{
			TransactionTemplate temp = new TransactionTemplate();
			temp.PlatformTransactionManager = new MockTxnPlatformMgr();
			temp.AfterPropertiesSet();
		}
Exemplo n.º 12
0
		public void NoTxnMgr()
		{
			TransactionTemplate temp = new TransactionTemplate();
			temp.AfterPropertiesSet();
		}
Exemplo n.º 13
0
 public void TxnMgr()
 {
     TransactionTemplate temp = new TransactionTemplate();
     temp.PlatformTransactionManager = MockRepository.GenerateMock<IPlatformTransactionManager>();
     temp.AfterPropertiesSet();
 }
 public void NoTxnMgr()
 {
     TransactionTemplate temp = new TransactionTemplate();
     Assert.Throws<ArgumentException>(() => temp.AfterPropertiesSet());
 }