public void AddEmptyTransactionRow_IncreasesUndocountByOne()
        {
            foreach (var xml in goodXmlExamples)
            {
                var x2o = new GranitXmlToAdapterBinder(xml, true);

                Assert.AreEqual(x2o.History.UndoCount, 0);
                _ = x2o.AddEmptyTransactionRow();
                Assert.AreEqual(x2o.History.UndoCount, 1);
            }
        }
 public void AddEmptyTransactionRow_IncreasesTransactionCountByOne_Test()
 {
     foreach (var xml in goodXmlExamples)
     {
         var x2o       = new GranitXmlToAdapterBinder(xml, true);
         int origCount = x2o.HUFTransactionsAdapter.TransactionAdapters.Count;
         _ = x2o.AddEmptyTransactionRow();
         int afterCount = x2o.HUFTransactionsAdapter.TransactionAdapters.Count;
         Assert.AreEqual(origCount + 1, afterCount);
     }
 }
        public void AddEmptyTransactionRow_Test()
        {
            foreach (var xml in goodXmlExamples)
            {
                var x2o = new GranitXmlToAdapterBinder(xml, true);

                int origCount = x2o.TransactionCount;

                x2o.AddEmptyTransactionRow();

                Assert.AreEqual(x2o.History.UndoCount, 1);
                Assert.AreEqual(x2o.GranitXDocument.Root.Elements().ToList().Count, origCount + 1);
            }
        }
        public void AddEmptyTransactionRow_ReturnsWithTheLargestId_Test()
        {
            foreach (var xml in goodXmlExamples)
            {
                var x2o = new GranitXmlToAdapterBinder(xml, true);

                TransactionAdapter newTa = x2o.AddEmptyTransactionRow();
                foreach (var ta in x2o.HUFTransactionsAdapter.TransactionAdapters)
                {
                    Assert.IsTrue(newTa.TransactionId >= ta.TransactionId);
                }

                Assert.AreEqual(x2o.GranitXDocument.Root.Elements(Constants.Transaction)
                                .Where(t => t.Attribute(Constants.TransactionIdAttribute).Value == newTa.TransactionId.ToString()).Count(), 1);
            }
        }