Removing ifdefs from test

Fixes #210
This commit is contained in:
Pranav K 2016-03-17 16:43:52 -07:00
parent 90235c7008
commit 1d76db4d36
4 changed files with 13 additions and 17 deletions

View File

@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Localization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.PlatformAbstractions;
namespace LocalizationSample
{

View File

@ -5,18 +5,15 @@ using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Extensions.PlatformAbstractions;
using Xunit;
namespace Microsoft.AspNetCore.Localization.FunctionalTests
{
public class LocalizationSampleTest
{
private static readonly string _applicationPath =
#if NET451
Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "..", "samples", "LocalizationSample"));
#else
Path.GetFullPath(Path.Combine("..", "..", "samples", "LocalizationSample"));
#endif
private static readonly string _applicationPath = Path.GetFullPath(
Path.Combine(PlatformServices.Default.Application.ApplicationBasePath, "..", "..", "..", "..", "..", "..", "samples", "LocalizationSample"));
[ConditionalTheory]
[OSSkipCondition(OperatingSystems.Linux)]

View File

@ -5,18 +5,15 @@ using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Extensions.PlatformAbstractions;
using Xunit;
namespace Microsoft.AspNetCore.Localization.FunctionalTests
{
public class LocalizationTest
{
private static readonly string _applicationPath =
#if NET451
Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", "LocalizationWebsite"));
#else
Path.GetFullPath(Path.Combine("..", "LocalizationWebsite"));
#endif
private static readonly string _applicationPath = Path.GetFullPath(
Path.Combine(PlatformServices.Default.Application.ApplicationBasePath, "..", "..", "..", "..", "..", "LocalizationWebsite"));
[ConditionalTheory]
[OSSkipCondition(OperatingSystems.Linux)]

View File

@ -14,11 +14,12 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
public class TestRunner
{
private string _applicationPath;
public TestRunner(string applicationPath){
public TestRunner(string applicationPath)
{
_applicationPath = applicationPath;
}
private async Task<string> RunTestAndGetResponse(
RuntimeFlavor runtimeFlavor,
RuntimeArchitecture runtimeArchitecture,
@ -61,7 +62,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
}
}
}
public async Task RunTestAndVerifyResponse(
RuntimeFlavor runtimeFlavor,
RuntimeArchitecture runtimeArchitecture,
@ -74,7 +75,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
Console.WriteLine("Response Text " + responseText);
Assert.Equal(expectedText, responseText);
}
public async Task RunTestAndVerifyResponseHeading(
RuntimeFlavor runtimeFlavor,
RuntimeArchitecture runtimeArchitecture,