예제 #1
0
 public void Ctor_Description(string description)
 {
     using (var transaction = new TestDesignerTransaction(description))
     {
         Assert.Same(description, transaction.Description);
         Assert.False(transaction.Canceled);
         Assert.False(transaction.Committed);
     }
 }
예제 #2
0
 public void Ctor_Default()
 {
     using (var transaction = new TestDesignerTransaction())
     {
         Assert.Empty(transaction.Description);
         Assert.False(transaction.Canceled);
         Assert.False(transaction.Committed);
     }
 }
예제 #3
0
        public void Commit_Cancelled_Success()
        {
            using (var transaction = new TestDesignerTransaction())
            {
                transaction.Cancel();

                transaction.Commit();
                Assert.Equal(0, transaction.CommitCount);
                Assert.False(transaction.Committed);
            }
        }
예제 #4
0
        public void Commit_NotCommitted_Success()
        {
            using (var transaction = new TestDesignerTransaction())
            {
                transaction.Commit();
                Assert.Equal(1, transaction.CommitCount);
                Assert.True(transaction.Committed);

                transaction.Commit();
                Assert.Equal(1, transaction.CommitCount);
                Assert.True(transaction.Committed);
            }
        }