mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-04-01 01:20:31 -04:00
Merge from master
This commit is contained in:
@@ -12,7 +12,7 @@ import { CapabilitiesTestService } from 'sqltest/stubs/capabilitiesTestService';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { formatServerNameWithDatabaseNameForAttachTo, getServerFromFormattedAttachToName, getDatabaseFromFormattedAttachToName } from 'sql/parts/notebook/notebookUtils';
|
||||
|
||||
describe('notebookUtils', function(): void {
|
||||
suite('notebookUtils', function(): void {
|
||||
let conn: IConnectionProfile = {
|
||||
connectionName: '',
|
||||
serverName: '',
|
||||
@@ -30,7 +30,7 @@ describe('notebookUtils', function(): void {
|
||||
azureTenantId: undefined
|
||||
};
|
||||
|
||||
it('Should format server and database name correctly for attach to', async function(): Promise<void> {
|
||||
test('Should format server and database name correctly for attach to', async function(): Promise<void> {
|
||||
let capabilitiesService = new CapabilitiesTestService();
|
||||
let connProfile = new ConnectionProfile(capabilitiesService, conn);
|
||||
connProfile.serverName = 'serverName';
|
||||
@@ -39,7 +39,7 @@ describe('notebookUtils', function(): void {
|
||||
should(attachToNameFormatted).equal('serverName (databaseName)');
|
||||
});
|
||||
|
||||
it('Should format server name correctly for attach to', async function(): Promise<void> {
|
||||
test('Should format server name correctly for attach to', async function(): Promise<void> {
|
||||
let capabilitiesService = new CapabilitiesTestService();
|
||||
let connProfile = new ConnectionProfile(capabilitiesService, conn);
|
||||
connProfile.serverName = 'serverName';
|
||||
@@ -47,7 +47,7 @@ describe('notebookUtils', function(): void {
|
||||
should(attachToNameFormatted).equal('serverName');
|
||||
});
|
||||
|
||||
it('Should format server name correctly for attach to when database is undefined', async function(): Promise<void> {
|
||||
test('Should format server name correctly for attach to when database is undefined', async function(): Promise<void> {
|
||||
let capabilitiesService = new CapabilitiesTestService();
|
||||
let connProfile = new ConnectionProfile(capabilitiesService, conn);
|
||||
connProfile.serverName = 'serverName';
|
||||
@@ -56,7 +56,7 @@ describe('notebookUtils', function(): void {
|
||||
should(attachToNameFormatted).equal('serverName');
|
||||
});
|
||||
|
||||
it('Should format server name as empty string when server/database are undefined', async function(): Promise<void> {
|
||||
test('Should format server name as empty string when server/database are undefined', async function(): Promise<void> {
|
||||
let capabilitiesService = new CapabilitiesTestService();
|
||||
let connProfile = new ConnectionProfile(capabilitiesService, conn);
|
||||
connProfile.serverName = undefined;
|
||||
@@ -65,21 +65,21 @@ describe('notebookUtils', function(): void {
|
||||
should(attachToNameFormatted).equal('');
|
||||
});
|
||||
|
||||
it('Should extract server name when no database specified', async function(): Promise<void> {
|
||||
test('Should extract server name when no database specified', async function(): Promise<void> {
|
||||
let serverName = getServerFromFormattedAttachToName('serverName');
|
||||
let databaseName = getDatabaseFromFormattedAttachToName('serverName');
|
||||
should(serverName).equal('serverName');
|
||||
should(databaseName).equal('');
|
||||
});
|
||||
|
||||
it('Should extract server and database name', async function(): Promise<void> {
|
||||
test('Should extract server and database name', async function(): Promise<void> {
|
||||
let serverName = getServerFromFormattedAttachToName('serverName (databaseName)');
|
||||
let databaseName = getDatabaseFromFormattedAttachToName('serverName (databaseName)');
|
||||
should(serverName).equal('serverName');
|
||||
should(databaseName).equal('databaseName');
|
||||
});
|
||||
|
||||
it('Should extract server and database name with other parentheses', async function(): Promise<void> {
|
||||
test('Should extract server and database name with other parentheses', async function(): Promise<void> {
|
||||
let serverName = getServerFromFormattedAttachToName('serv()erName (databaseName)');
|
||||
let databaseName = getDatabaseFromFormattedAttachToName('serv()erName (databaseName)');
|
||||
should(serverName).equal('serv()erName');
|
||||
|
||||
Reference in New Issue
Block a user