mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-08 17:24:01 -05:00
Add a few unit tests for dacpac extension (#9194)
* add a few unit tests * fix tests for linux
This commit is contained in:
@@ -12,7 +12,7 @@ export abstract class BasePage {
|
||||
protected readonly wizardPage: azdata.window.WizardPage;
|
||||
protected readonly model: DacFxDataModel;
|
||||
protected readonly view: azdata.ModelView;
|
||||
protected databaseValues: string[];
|
||||
public databaseValues: string[];
|
||||
|
||||
/**
|
||||
* This method constructs all the elements of the page.
|
||||
|
||||
@@ -207,7 +207,7 @@ export abstract class DacFxConfigPage extends BasePage {
|
||||
}
|
||||
|
||||
// Compares database name with existing databases on the server
|
||||
protected databaseNameExists(n: string): boolean {
|
||||
public databaseNameExists(n: string): boolean {
|
||||
for (let i = 0; i < this.databaseValues.length; ++i) {
|
||||
if (this.databaseValues[i].toLowerCase() === n.toLowerCase()) {
|
||||
// database name exists
|
||||
|
||||
@@ -120,7 +120,7 @@ export function isValidBasenameErrorMessage(name: string | null | undefined): st
|
||||
}
|
||||
|
||||
if (basename === '.' || basename === '..') {
|
||||
return loc.reservedWindowsFilenameErrorMessage; // check for reserved values
|
||||
return loc.reservedValueErrorMessage; // check for reserved values
|
||||
}
|
||||
|
||||
if (isWindows && basename.length !== basename.trim().length) {
|
||||
@@ -133,3 +133,7 @@ export function isValidBasenameErrorMessage(name: string | null | undefined): st
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
export function generateDatabaseName(filePath: string): string {
|
||||
return path.parse(filePath).name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user