#16849: Replacing strings and console.writelines by exception throwing.

--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-12-08 18:18:52 -08:00
parent c57a3ab642
commit 18d1e80189
12 changed files with 78 additions and 84 deletions

View File

@@ -58,16 +58,14 @@ namespace Orchard.Tests.Modules.CodeGeneration.Commands {
}
[Test]
[ExpectedException(typeof(OrchardException))]
public void CreateDataMigrationTestNonExistentFeature() {
CodeGenerationCommands codeGenerationCommands = new CodeGenerationCommands(_extensionManager,
_schemaCommandGenerator);
TextWriter textWriterOutput = new StringWriter();
codeGenerationCommands.Context = new CommandContext { Output = textWriterOutput };
bool result = codeGenerationCommands.CreateDataMigration("feature");
Assert.That(result, Is.False);
Assert.That(textWriterOutput.ToString(), Is.EqualTo("Creating Data Migration for feature\r\nCreating data migration failed: target Feature feature could not be found.\r\n"));
codeGenerationCommands.CreateDataMigration("feature");
}
}
}