public void UseSqlServerAuthenticationNoPasswordPrompts() { // Arrange var packageDeployer = new PackageDeployer(_console); // Act packageDeployer.UseSqlAuthentication("testuser", null); // Assert packageDeployer.ConnectionStringBuilder.IntegratedSecurity.ShouldBeFalse(); packageDeployer.ConnectionStringBuilder.UserID.ShouldBe("testuser"); _console.Received().ReadLine(); }
public void UseSqlAuthenticationWithPasswordDoesNotPrompt() { // Arrange var packageDeployer = new PackageDeployer(_console); // Act packageDeployer.UseSqlAuthentication("testuser", "testpassword"); // Assert packageDeployer.ConnectionStringBuilder.IntegratedSecurity.ShouldBeFalse(); packageDeployer.ConnectionStringBuilder.UserID.ShouldBe("testuser"); packageDeployer.ConnectionStringBuilder.Password.ShouldBe("testpassword"); _console.DidNotReceive().ReadLine(); }
public void UseSqlServerAuthenticationNoPasswordSetsPassword() { // Arrange _console.ReadLine().Returns("testpassword"); using var packageDeployer = new PackageDeployer(_console); var packagePath = BuildSimpleModel(); // Act packageDeployer.LoadPackage(packagePath); packageDeployer.UseSqlAuthentication("testuser", null); // Assert packageDeployer.ConnectionStringBuilder.IntegratedSecurity.ShouldBeFalse(); packageDeployer.ConnectionStringBuilder.UserID.ShouldBe("testuser"); packageDeployer.ConnectionStringBuilder.Password.ShouldBe("testpassword"); }