コード例 #1
0
		public void Migrate_TestData_TransformsOk()
		{
			string xml = @"<?xml version='1.0' encoding='UTF-8' ?>
<configuration version='1'>
  <blah />
</configuration>
".Replace("'", "\"");

			using (var sourceFile = new TempFile(xml))
			{
				using (var destinationFile = new TempFile())
				{
					var migrator = new MigratorForTest(1, 2);
					migrator.Migrate(sourceFile.Path, destinationFile.Path);
					string result = File.ReadAllText(destinationFile.Path);
					AssertThatXmlIn.String(result).HasAtLeastOneMatchForXpath("configuration[@version='2']");
					AssertThatXmlIn.String(result).HasAtLeastOneMatchForXpath("/configuration/blah");
				}
			}
		}
コード例 #2
0
        public void Migrate_TestData_TransformsOk()
        {
            string xml = @"<?xml version='1.0' encoding='UTF-8' ?>
<configuration version='1'>
  <blah />
</configuration>
".Replace("'", "\"");

            using (var sourceFile = new TempFile(xml))
            {
                using (var destinationFile = new TempFile())
                {
                    var migrator = new MigratorForTest(1, 2);
                    migrator.Migrate(sourceFile.Path, destinationFile.Path);
                    string result = File.ReadAllText(destinationFile.Path);
                    AssertThatXmlIn.String(result).HasAtLeastOneMatchForXpath("configuration[@version='2']");
                    AssertThatXmlIn.String(result).HasAtLeastOneMatchForXpath("/configuration/blah");
                }
            }
        }
コード例 #3
0
		public void Constructor_FromLessThanTo_Throws()
		{
			Assert.Throws<ArgumentException>(
				() => { var migrator = new MigratorForTest(5, 4); }
			);
		}
コード例 #4
0
 public void Constructor_FromLessThanTo_Throws()
 {
     Assert.Throws <ArgumentException>(
         () => { var migrator = new MigratorForTest(5, 4); }
         );
 }