protected override void InternalExecute(MigrationParameters parameters)
        {
            System.Console.WriteLine();

            using(new ConsoleStylingScope(ConsoleColor.Green))
                System.Console.WriteLine("Reverse engineering '{0}'", parameters.ConnectionString);

            IReverseEngineeringService reverseEngineeringService = ServiceProvider.GetService<IReverseEngineeringService>();
            IDbPlatform dbPlatform = ServiceProvider.GetService<IDbPlatform>();

            IAstNode astNode = reverseEngineeringService.ReverseEngineer(dbPlatform, parameters.ConnectionString);

            MdlGenerator mdlGenerator = new MdlGenerator();

            using(FileStream fs = new FileStream("baseline.mdl", FileMode.Create))
            {
                using(StreamWriter streamWriter = new StreamWriter(fs, Encoding.UTF8))
                {
                    mdlGenerator.Generate(astNode, streamWriter);
                    streamWriter.Flush();
                } // using
            } // using
        }
        string GetFragment(IAstNode astNode)
        {
            StringBuilder sb = new StringBuilder();
            using(StringWriter stringWriter = new StringWriter(sb))
            {
                MdlGenerator mdlGenerator = new MdlGenerator();   
                mdlGenerator.Generate(astNode, stringWriter);
            }

            return sb.ToString();
        }
        public void Generate()
        {
            IAstNode astNode;

            IMdlParser mdlParser;
            using(Stream resourceStream =
                Assembly.GetExecutingAssembly().GetManifestResourceStream("octalforty.Wizardby.Tests.Resources.Oxite.mdl"))
            {
                mdlParser = new MdlParser(MdlParserTestFixture.CreateScanner(new StreamReader(resourceStream, Encoding.UTF8)));
                astNode = mdlParser.Parse();
            } // using
            
            MdlGenerator mdlGenerator = new MdlGenerator();

            StringBuilder mdlBuilder = new StringBuilder();
            mdlGenerator.Generate(astNode, new StringWriter(mdlBuilder));

            Assert.AreEqual(@"migration ""Oxite"" revision => 1:
    type-aliases:
        type-alias PK type => Guid, nullable => false
        type-alias LongName type => String, length => 256, nullable => false
        type-alias MediumName type => String, length => 128, nullable => false
        type-alias ShortName type => String, length => 100, nullable => false
    version 20090323103239:
        add table oxite_Language:
            add column LanguageID type => Guid, nullable => false, primary-key => true
            add column LanguageName type => AnsiString, length => 8, nullable => false
            add column LanguageDisplayName type => String, length => 50, nullable => false
    version 20090330170528:
        add table oxite_User:
            add column UserID type => PK, primary-key => true
            add column Username type => LongName, unique => true
            add column DisplayName type => LongName
            add column Email type => LongName
            add column HashedEmail type => ShortName
            add column Password type => MediumName
            add column PasswordSalt type => MediumName
            add column DefaultLanguageID references => oxite_Language
            add column Status type => Byte, nullable => false
        add table oxite_UserLanguage:
            add column UserID references => oxite_User, primary-key => true
            add column LanguageID references => oxite_Language, primary-key => true
            add index """" columns => [UserID, LanguageID], unique => true, clustered => true
            add index """" column => [UserID, asc]
    version 20090331135627:
        add table oxite_Role:
            add column RoleID type => PK, primary-key => true
            add column ParentRoleID references => oxite_Role, nullable => true
            add column RoleName type => LongName
        add table oxite_UserRoleRelationship:
            add column UserID references => oxite_User, primary-key => true
            add column RoleID references => oxite_Role, primary-key => true
    version 20090331140131:
        add table oxite_FileResource:
            add column FileResourceID type => PK, primary-key => true
            add column SiteID type => Guid, nullable => false
            add column FileResourceName type => LongName
            add column CreatorUserID references => oxite_User
            add column Data type => Binary
            add column ContentType type => AnsiString, length => 25, nullable => false
            add column Path type => String, length => 1000, nullable => false
            add column State type => Byte, nullable => false
            add column CreatedDate type => DateTime, nullable => false
            add column ModifiedDate type => DateTime, nullable => false
        add table oxite_UserFileResourceRelationship:
            add column UserID references => oxite_User
            add column FileResourceID references => oxite_FileResource:
                add index """" unique => true
            add index """" columns => [UserID, FileResourceID], unique => true, clustered => true
", mdlBuilder.ToString());

            mdlParser = new MdlParser(MdlParserTestFixture.CreateScanner(new StringReader(mdlBuilder.ToString())));
            IAstNode reparsedNode = mdlParser.Parse();
        }