Enable tests

This commit is contained in:
Daniel Plaisted 2018-10-29 11:26:53 -07:00
parent ac23150af3
commit 96c79f9661
26 changed files with 288 additions and 394 deletions

View file

@ -141,57 +141,55 @@ namespace EndToEnd
public void WeCoverLatestNetCoreAppRollForward()
{
// Run "dotnet new console", get TargetFramework property, and make sure it's covered in SupportedNetCoreAppVersions
using (DisposableDirectory directory = Temp.CreateDirectory())
{
string projectDirectory = directory.Path;
var directory = TestAssets.CreateTestDirectory();
string projectDirectory = directory.FullName;
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute("console --no-restore")
.Should().Pass();
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute("console --no-restore")
.Should().Pass();
string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj");
string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj");
var project = XDocument.Load(projectPath);
var ns = project.Root.Name.Namespace;
var project = XDocument.Load(projectPath);
var ns = project.Root.Name.Namespace;
string targetFramework = project.Root.Element(ns + "PropertyGroup")
.Element(ns + "TargetFramework")
.Value;
string targetFramework = project.Root.Element(ns + "PropertyGroup")
.Element(ns + "TargetFramework")
.Value;
SupportedNetCoreAppVersions.Versions.Select(v => $"netcoreapp{v}")
.Should().Contain(targetFramework, $"the {nameof(SupportedNetCoreAppVersions)}.{nameof(SupportedNetCoreAppVersions.Versions)} property should include the default version " +
"of .NET Core created by \"dotnet new\"");
}
SupportedNetCoreAppVersions.Versions.Select(v => $"netcoreapp{v}")
.Should().Contain(targetFramework, $"the {nameof(SupportedNetCoreAppVersions)}.{nameof(SupportedNetCoreAppVersions.Versions)} property should include the default version " +
"of .NET Core created by \"dotnet new\"");
}
[Fact]
public void WeCoverLatestAspNetCoreAppRollForward()
{
var directory = TestAssets.CreateTestDirectory();
string projectDirectory = directory.FullName;
// Run "dotnet new web", get TargetFramework property, and make sure it's covered in SupportedAspNetCoreAppVersions
using (DisposableDirectory directory = Temp.CreateDirectory())
{
string projectDirectory = directory.Path;
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute("web --no-restore")
.Should().Pass();
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute("web --no-restore")
.Should().Pass();
string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj");
string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj");
var project = XDocument.Load(projectPath);
var ns = project.Root.Name.Namespace;
var project = XDocument.Load(projectPath);
var ns = project.Root.Name.Namespace;
string targetFramework = project.Root.Element(ns + "PropertyGroup")
.Element(ns + "TargetFramework")
.Value;
string targetFramework = project.Root.Element(ns + "PropertyGroup")
.Element(ns + "TargetFramework")
.Value;
SupportedAspNetCoreVersions.Versions.Select(v => $"netcoreapp{v}")
.Should().Contain(targetFramework, $"the {nameof(SupportedAspNetCoreVersions)} should include the default version " +
"of Microsoft.AspNetCore.App used by the templates created by \"dotnet new web\"");
SupportedAspNetCoreVersions.Versions.Select(v => $"netcoreapp{v}")
.Should().Contain(targetFramework, $"the {nameof(SupportedAspNetCoreVersions)} should include the default version " +
"of Microsoft.AspNetCore.App used by the templates created by \"dotnet new web\"");
}
}
}