parent
90235c7008
commit
1d76db4d36
|
|
@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Localization;
|
using Microsoft.AspNetCore.Localization;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using Microsoft.Extensions.PlatformAbstractions;
|
||||||
|
|
||||||
namespace LocalizationSample
|
namespace LocalizationSample
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,15 @@ using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Server.Testing;
|
using Microsoft.AspNetCore.Server.Testing;
|
||||||
using Microsoft.AspNetCore.Testing.xunit;
|
using Microsoft.AspNetCore.Testing.xunit;
|
||||||
|
using Microsoft.Extensions.PlatformAbstractions;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Localization.FunctionalTests
|
namespace Microsoft.AspNetCore.Localization.FunctionalTests
|
||||||
{
|
{
|
||||||
public class LocalizationSampleTest
|
public class LocalizationSampleTest
|
||||||
{
|
{
|
||||||
private static readonly string _applicationPath =
|
private static readonly string _applicationPath = Path.GetFullPath(
|
||||||
#if NET451
|
Path.Combine(PlatformServices.Default.Application.ApplicationBasePath, "..", "..", "..", "..", "..", "..", "samples", "LocalizationSample"));
|
||||||
Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "..", "samples", "LocalizationSample"));
|
|
||||||
#else
|
|
||||||
Path.GetFullPath(Path.Combine("..", "..", "samples", "LocalizationSample"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,15 @@ using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Server.Testing;
|
using Microsoft.AspNetCore.Server.Testing;
|
||||||
using Microsoft.AspNetCore.Testing.xunit;
|
using Microsoft.AspNetCore.Testing.xunit;
|
||||||
|
using Microsoft.Extensions.PlatformAbstractions;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Localization.FunctionalTests
|
namespace Microsoft.AspNetCore.Localization.FunctionalTests
|
||||||
{
|
{
|
||||||
public class LocalizationTest
|
public class LocalizationTest
|
||||||
{
|
{
|
||||||
private static readonly string _applicationPath =
|
private static readonly string _applicationPath = Path.GetFullPath(
|
||||||
#if NET451
|
Path.Combine(PlatformServices.Default.Application.ApplicationBasePath, "..", "..", "..", "..", "..", "LocalizationWebsite"));
|
||||||
Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "LocalizationWebsite"));
|
|
||||||
#else
|
|
||||||
Path.GetFullPath(Path.Combine("..", "LocalizationWebsite"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux)]
|
[OSSkipCondition(OperatingSystems.Linux)]
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,12 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
|
||||||
public class TestRunner
|
public class TestRunner
|
||||||
{
|
{
|
||||||
private string _applicationPath;
|
private string _applicationPath;
|
||||||
|
|
||||||
public TestRunner(string applicationPath){
|
public TestRunner(string applicationPath)
|
||||||
|
{
|
||||||
_applicationPath = applicationPath;
|
_applicationPath = applicationPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> RunTestAndGetResponse(
|
private async Task<string> RunTestAndGetResponse(
|
||||||
RuntimeFlavor runtimeFlavor,
|
RuntimeFlavor runtimeFlavor,
|
||||||
RuntimeArchitecture runtimeArchitecture,
|
RuntimeArchitecture runtimeArchitecture,
|
||||||
|
|
@ -61,7 +62,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RunTestAndVerifyResponse(
|
public async Task RunTestAndVerifyResponse(
|
||||||
RuntimeFlavor runtimeFlavor,
|
RuntimeFlavor runtimeFlavor,
|
||||||
RuntimeArchitecture runtimeArchitecture,
|
RuntimeArchitecture runtimeArchitecture,
|
||||||
|
|
@ -74,7 +75,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
|
||||||
Console.WriteLine("Response Text " + responseText);
|
Console.WriteLine("Response Text " + responseText);
|
||||||
Assert.Equal(expectedText, responseText);
|
Assert.Equal(expectedText, responseText);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RunTestAndVerifyResponseHeading(
|
public async Task RunTestAndVerifyResponseHeading(
|
||||||
RuntimeFlavor runtimeFlavor,
|
RuntimeFlavor runtimeFlavor,
|
||||||
RuntimeArchitecture runtimeArchitecture,
|
RuntimeArchitecture runtimeArchitecture,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue