public void TearDown() { DatabaseMigrator.CleanUp(); MigrationsAssembly = null; Logger = null; DatabaseMigrator = null; NewWindowsLogin = null; }
public void NewDatabaseWindowsLogin_Execute_CreatesWindowsLogin() { NewWindowsLogin = new NewWindowsLogin(Logger, @"cnw\cnwar5"); NewWindowsLogin.Execute(Settings); Assert.That(Log.ToString(), Is.Not.Empty); Trace.WriteLine(Log.ToString()); Console.WriteLine(Log.ToString()); }
protected override void ProcessRecord() { if (string.IsNullOrEmpty(Language)) { Language = "CSharp"; } if (string.IsNullOrEmpty(Provider)) { Provider = "SqlServer"; } try { var newWindowsLogin = new NewWindowsLogin(new TaskLogger(this), UserName); if (!string.IsNullOrEmpty(this.Directory)) { ScriptEngine engine = new ScriptEngine(this.Language, null); newWindowsLogin.Execute(engine.Compile(this.Directory)); } if (MigrationsAssemblyPath != null) { Assembly asm = Assembly.LoadFrom(this.MigrationsAssemblyPath); newWindowsLogin.Execute(asm); } else if (Settings != null) { newWindowsLogin.Execute(Settings.ToDictionary()); } } catch (Exception e) { ThrowTerminatingError( new ErrorRecord( e, "New-DatabaseWindowsLogin", ErrorCategory.NotSpecified, this ) ); } }