mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
* Make nullable warnings a per file opt-in * Remove unneeded compiler directives * Remove compiler directive for User Data
61 lines
2.0 KiB
C#
61 lines
2.0 KiB
C#
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
//
|
|
|
|
#nullable disable
|
|
|
|
using Microsoft.SqlTools.ServiceLayer.Utility;
|
|
using NUnit.Framework;
|
|
|
|
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ServiceHost
|
|
{
|
|
/// <summary>
|
|
/// ScriptFile test case
|
|
/// </summary>
|
|
public class SrTests
|
|
{
|
|
[Test]
|
|
public void SrStringsTestWithEnLocalization()
|
|
{
|
|
string locale = "en";
|
|
var args = new string[] { "--locale", locale };
|
|
ServiceLayerCommandOptions options = new ServiceLayerCommandOptions(args);
|
|
Assert.AreEqual(SR.Culture.Name, options.Locale);
|
|
Assert.AreEqual(options.Locale, locale);
|
|
|
|
var TestLocalizationConstant = SR.TestLocalizationConstant;
|
|
Assert.AreEqual("test", TestLocalizationConstant);
|
|
}
|
|
|
|
[Test]
|
|
public void SrStringsTestWithEsLocalization()
|
|
{
|
|
string locale = "es";
|
|
var args = new string[] { "--locale", locale };
|
|
ServiceLayerCommandOptions options = new ServiceLayerCommandOptions(args);
|
|
Assert.AreEqual(SR.Culture.Name, options.Locale);
|
|
Assert.AreEqual(options.Locale, locale);
|
|
|
|
var TestLocalizationConstant = SR.TestLocalizationConstant;
|
|
Assert.AreEqual("prueba", TestLocalizationConstant);
|
|
|
|
// Reset the locale
|
|
SrStringsTestWithEnLocalization();
|
|
}
|
|
|
|
[Test]
|
|
public void SrStringsTestWithNullLocalization()
|
|
{
|
|
SR.Culture = null;
|
|
var args = new string[] { "" };
|
|
ServiceLayerCommandOptions options = new ServiceLayerCommandOptions(args);
|
|
Assert.Null(SR.Culture);
|
|
Assert.AreEqual("", options.Locale);
|
|
|
|
var TestLocalizationConstant = SR.TestLocalizationConstant;
|
|
Assert.AreEqual("test", TestLocalizationConstant);
|
|
}
|
|
}
|
|
}
|