Exemple #1
0
        public void Should_keep_ver_for_newer_schemas()
        {
            var   xaml  = new Case4Evolver().UpgradeDatabaseXaml(@"<Case4 xmlns='test' Ver='2000' />");
            var   d     = Dynamic(xaml);
            Case4 case4 = Load(d);

            Assert.AreEqual(2000m, case4.Ver);
        }
Exemple #2
0
        public void Should_use_another_field_for_version()
        {
            var   xaml  = new Case4Evolver().UpgradeDatabaseXaml(@"<Case4 xmlns='test' Version='555' />");
            var   d     = Dynamic(xaml);
            Case4 case4 = Load(d);

            Assert.AreEqual(555ul, case4.VersionStamp);
            Assert.AreEqual(10m, case4.Ver);
        }
Exemple #3
0
        public void Should_initialize_ver()
        {
            var   ev    = new Case4Evolver();
            var   xaml  = XamlServices.Save(ev.CreateRoot());
            var   d     = Dynamic(xaml);
            Case4 case4 = Load(d);

            Assert.AreEqual(10m, case4.Ver);
            Assert.AreEqual(0UL, case4.VersionStamp);
        }
Exemple #4
0
        public void Should_complain_on_non_initialized_ver()
        {
            var xaml = XamlServices.Save(new Case4());

            Console.WriteLine(xaml);
            var ex = Record(delegate
            {
                xaml = new Case4Evolver().UpgradeDatabaseXaml(xaml);
            });

            Assert.IsNotNull(ex);
            Assert.IsInstanceOfType(ex, typeof(EvolverException));
            StringAssert.Contains(ex.Message, "There is no upgrade method for current schema version -1");
        }