public async Task GetSecureConnectionStringTest() { string paramvalue = "TopSecretPassword"; A.CallTo(() => _parameterStoreRequest.GetParameterValue(A <string> ._)).Returns(Task.FromResult(paramvalue)); var connectionString = await _connectionInfoAsync.GetConnectionStringAsync(); Assert.That(connectionString, Is.EqualTo(_connectionStringWithPassword)); }
public async Task <string> GetConnectionStringAsync() { if (ShouldAppendString(_connectionString)) { string username = GetDatabaseUsername(_connectionString); string password = await _parameterStoreRequest.GetParameterValue(username); StringBuilder sb = new StringBuilder(_connectionString); sb.Append(StringToReplace).Append(password).Append(";"); return(sb.ToString()); } return(_connectionString); }