From ea5b151dcdef8da9f66d531453b140b2a9344552 Mon Sep 17 00:00:00 2001 From: Raymond Martin Date: Wed, 5 Apr 2017 15:49:44 -0700 Subject: [PATCH] Removing unused constants (#299) * removing unused constants * updating test strings * adding edit data string * fixing tests --- .../Localization/sr.cs | 44 ------------------- .../Localization/sr.resx | 18 +------- .../Localization/sr.strings | 13 +----- .../Localization/sr.xlf | 32 +++----------- .../ServiceHost/SrTests.cs | 4 +- .../Utility/SrTests.cs | 1 - 6 files changed, 10 insertions(+), 102 deletions(-) diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs index 575baee4..049a67af 100755 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs @@ -77,14 +77,6 @@ namespace Microsoft.SqlTools.ServiceLayer } } - public static string ErrorUnexpectedCodeObjectType - { - get - { - return Keys.GetString(Keys.ErrorUnexpectedCodeObjectType); - } - } - public static string QueryServiceCancelAlreadyCompleted { get @@ -509,14 +501,6 @@ namespace Microsoft.SqlTools.ServiceLayer } } - public static string EditDataColumnUpdateNotPending - { - get - { - return Keys.GetString(Keys.EditDataColumnUpdateNotPending); - } - } - public static string EditDataObjectMetadataNotFound { get @@ -605,14 +589,6 @@ namespace Microsoft.SqlTools.ServiceLayer } } - public static string EditDataInitializeInProgress - { - get - { - return Keys.GetString(Keys.EditDataInitializeInProgress); - } - } - public static string EditDataTimeOver24Hrs { get @@ -877,14 +853,6 @@ namespace Microsoft.SqlTools.ServiceLayer } } - public static string SqlScriptFormatterMultipartDecodeFail - { - get - { - return Keys.GetString(Keys.SqlScriptFormatterMultipartDecodeFail); - } - } - public static string ConnectionServiceListDbErrorNotConnected(string uri) { return Keys.GetString(Keys.ConnectionServiceListDbErrorNotConnected, uri); @@ -996,9 +964,6 @@ namespace Microsoft.SqlTools.ServiceLayer public const string ConnectionParamsValidateNullSqlAuth = "ConnectionParamsValidateNullSqlAuth"; - public const string ErrorUnexpectedCodeObjectType = "ErrorUnexpectedCodeObjectType"; - - public const string QueryServiceCancelAlreadyCompleted = "QueryServiceCancelAlreadyCompleted"; @@ -1185,9 +1150,6 @@ namespace Microsoft.SqlTools.ServiceLayer public const string EditDataUpdateNotPending = "EditDataUpdateNotPending"; - public const string EditDataColumnUpdateNotPending = "EditDataColumnUpdateNotPending"; - - public const string EditDataObjectMetadataNotFound = "EditDataObjectMetadataNotFound"; @@ -1221,9 +1183,6 @@ namespace Microsoft.SqlTools.ServiceLayer public const string EditDataComputedColumnPlaceholder = "EditDataComputedColumnPlaceholder"; - public const string EditDataInitializeInProgress = "EditDataInitializeInProgress"; - - public const string EditDataTimeOver24Hrs = "EditDataTimeOver24Hrs"; @@ -1323,9 +1282,6 @@ namespace Microsoft.SqlTools.ServiceLayer public const string SqlScriptFormatterDecimalMissingPrecision = "SqlScriptFormatterDecimalMissingPrecision"; - public const string SqlScriptFormatterMultipartDecodeFail = "SqlScriptFormatterMultipartDecodeFail"; - - private Keys() { } diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx index 6ffd0b0c..f7ee389e 100755 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx @@ -166,10 +166,6 @@ . Parameters: 0 - component (string) - - Cannot convert SqlCodeObject Type {0} to Type {1} - - The query has already completed, it cannot be cancelled @@ -427,10 +423,6 @@ Given row ID does not have pending update - - Give column ID does not have pending update - - Table or view metadata could not be found @@ -475,10 +467,6 @@ <TBD> - - Another edit data initialize is in progress for this owner URI. Please wait for completion. - - TIME column values must be between 00:00:00.0000000 and 23:59:59.9999999 @@ -604,15 +592,11 @@ - EN_LOCALIZATION + test Decimal column is missing numeric precision or numeric scale - - Multipart identifier is incorrectly formatted - - diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings index 9d7b1d92..d4917c6b 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings @@ -47,11 +47,6 @@ ConnectionParamsValidateNullServerName = ServerName cannot be null or empty ConnectionParamsValidateNullSqlAuth(string component) = {0} cannot be null or empty when using SqlLogin authentication -############################################################################ -# Formatter - -ErrorUnexpectedCodeObjectType = Cannot convert SqlCodeObject Type {0} to Type {1} - ############################################################################ # Query Execution Service @@ -202,8 +197,6 @@ EditDataUpdatePending = An update is already pending for this row and must be re EditDataUpdateNotPending = Given row ID does not have pending update -EditDataColumnUpdateNotPending = Give column ID does not have pending update - EditDataObjectMetadataNotFound = Table or view metadata could not be found EditDataInvalidFormatBinary = Invalid format for binary column @@ -226,8 +219,6 @@ EditDataCommitInProgress = A commit task is in progress. Please wait for complet EditDataComputedColumnPlaceholder = -EditDataInitializeInProgress = Another edit data initialize is in progress for this owner URI. Please wait for completion. - EditDataTimeOver24Hrs = TIME column values must be between 00:00:00.0000000 and 23:59:59.9999999 EditDataNullNotAllowed = NULL is not allowed for this column @@ -296,11 +287,9 @@ BatchParser_VariableNotDefined = Variable {0} is not defined. ############################################################################ # Workspace Service -TestLocalizationConstant = EN_LOCALIZATION +TestLocalizationConstant = test ############################################################################ # Utilities SqlScriptFormatterDecimalMissingPrecision = Decimal column is missing numeric precision or numeric scale - -SqlScriptFormatterMultipartDecodeFail = Multipart identifier is incorrectly formatted diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf index 4e0d9930..0936f7a7 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf +++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf @@ -415,15 +415,10 @@ - EN_LOCALIZATION + test EN_LOCALIZATION - - Cannot convert SqlCodeObject Type {0} to Type {1} - Cannot convert SqlCodeObject Type {0} to Type {1} - - Replacement of an empty string by an empty string. Replacement of an empty string by an empty string. @@ -536,16 +531,6 @@ <TBD> - - Give column ID does not have pending update - Give column ID does not have pending update - - - - Another edit data initialize is in progress for this owner URI. Please wait for completion. - Another edit data initialize is in progress for this owner URI. Please wait for completion. - - Cannot add row to result buffer, data reader does not contain rows Cannot add row to result buffer, data reader does not contain rows @@ -561,11 +546,6 @@ NULL is not allowed for this column - - Table or view requested for edit could not be found - Table or view requested to edit could not be found - - Edit session already exists. Edit session already exists. @@ -601,11 +581,6 @@ NULL - - Multipart identifier is incorrectly formatted - Multipart identifier is incorrectly formatted - - A object name must be provided A object name must be provided @@ -621,6 +596,11 @@ Table metadata does not have extended properties + + Table or view requested for edit could not be found + Table or view requested for edit could not be found + + \ No newline at end of file diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/SrTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/SrTests.cs index ca8dc0a0..0b9a9aa4 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/SrTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/ServiceHost/SrTests.cs @@ -55,7 +55,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ServiceHost Assert.Equal(options.Locale, locale); var TestLocalizationConstant = SR.TestLocalizationConstant; - Assert.Equal(TestLocalizationConstant, "EN_LOCALIZATION"); + Assert.Equal(TestLocalizationConstant, "test"); } [Fact] @@ -81,7 +81,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ServiceHost Assert.Equal(options.Locale, ""); var TestLocalizationConstant = SR.TestLocalizationConstant; - Assert.Equal(TestLocalizationConstant, "EN_LOCALIZATION"); + Assert.Equal(TestLocalizationConstant, "test"); } } } diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/SrTests.cs b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/SrTests.cs index e8a863da..8cd88184 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/SrTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Utility/SrTests.cs @@ -72,7 +72,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Utility Assert.NotNull(ServiceLayerSr.EE_ScriptError_ParsingSyntax); Assert.NotNull(ServiceLayerSr.EE_ScriptError_Warning); Assert.NotNull(ServiceLayerSr.ErrorEmptyStringReplacement); - Assert.NotNull(ServiceLayerSr.ErrorUnexpectedCodeObjectType); Assert.Null(ServiceLayerSr.HostingHeaderMissingColon); Assert.Null(ServiceLayerSr.HostingHeaderMissingContentLengthHeader); Assert.Null(ServiceLayerSr.HostingHeaderMissingContentLengthValue);