Example #1
0
        public void TestChangedProp()
        {
            var      handler  = new TestXmlCompareHandler();
            Comparer comparer = new Comparer();

            comparer.Compare(@"XmlFiles/Models.xml", @"XmlFiles/Models1.xml", handler);

            //normal operation
            IsPropertyChanged("MaxBet", comparer);
            IsPropertyRemoved("ShouldWaitForPdb", comparer);
            IsPropertyAdded("BroadcastAddress", comparer);

            //condition change in right file
            IsPropertyRemoved("FundTransferType", comparer);
            IsPropertyAdded("FundTransferType", comparer);

            //condition change in left file
            IsPropertyRemoved("AlternateAccountLookup", comparer);
            IsPropertyAdded("AlternateAccountLookup", comparer);

            //removed property in a list
            //IsPropertyRemoved("MeterTracker", comparer);

            //removed property from a list in left file
            IsPropertyAdded("3", comparer);

            //removing object in right file
            IsPropertyRemoved("G2SModel", comparer);

            //removing object in left file
            IsPropertyAdded("PhysicalIdReader", comparer);

            EnsureListCount(5, 4, 1, comparer);
        }
Example #2
0
        public static void Main(string filename1, string filename2, string destinationfilepath, string newfilename)
        {
            try
            {
                var handler = new TestXmlCompareHandler(destinationfilepath, newfilename);

                using (var comparer = new Comparer(handler))
                {
                    comparer.Compare(filename1, filename2, handler);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("ERROR: " + ex);
            }
        }