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"); } } }
public void Constructor_FromLessThanTo_Throws() { Assert.Throws<ArgumentException>( () => { var migrator = new MigratorForTest(5, 4); } ); }
public void Constructor_FromLessThanTo_Throws() { Assert.Throws <ArgumentException>( () => { var migrator = new MigratorForTest(5, 4); } ); }