Applied expression bodies for methods to solution.

This commit is contained in:
Michael Yanni 2023-11-10 17:08:10 -08:00
parent c9ab438e6c
commit 67cbc0dd65
36 changed files with 106 additions and 378 deletions

View file

@ -31,8 +31,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
}
}
private void DebianPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile)
{
private void DebianPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile) =>
// Example output:
// $ dpkg --info dotnet-sdk-2.1.105-ubuntu-x64.deb
@ -58,10 +57,8 @@ namespace Microsoft.DotNet.Tests.EndToEnd
.Should().Pass()
.And.HaveStdOutMatching(@"Depends:.*\s?dotnet-runtime-\d+(\.\d+){2}")
.And.HaveStdOutMatching(@"Depends:.*\s?aspnetcore-store-\d+(\.\d+){2}");
}
private void RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile)
{
private void RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile) =>
// Example output:
// $ rpm -qpR dotnet-sdk-2.1.105-rhel-x64.rpm
@ -78,6 +75,5 @@ namespace Microsoft.DotNet.Tests.EndToEnd
.Should().Pass()
.And.HaveStdOutMatching(@"dotnet-runtime-\d+(\.\d+){2} >= \d+(\.\d+){2}")
.And.HaveStdOutMatching(@"aspnetcore-store-\d+(\.\d+){2} >= \d+(\.\d+){2}");
}
}
}

View file

@ -7,11 +7,8 @@ namespace EndToEnd
public class GivenDotnetUsesDotnetTools : TestBase
{
[RequiresAspNetCore]
public void ThenOneDotnetToolsCanBeCalled()
{
new DotnetCommand()
public void ThenOneDotnetToolsCanBeCalled() => new DotnetCommand()
.ExecuteWithCapturedOutput("dev-certs --help")
.Should().Pass();
}
}
}

View file

@ -40,10 +40,7 @@ namespace EndToEnd
[Theory]
[ClassData(typeof(SupportedAspNetCoreAllVersions))]
public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreAll(string minorVersion)
{
ItDoesNotRollForwardToTheLatestVersion(TestProjectCreator.AspNetCoreAllPackageName, minorVersion);
}
public void ItDoesNotRollForwardToTheLatestVersionOfAspNetCoreAll(string minorVersion) => ItDoesNotRollForwardToTheLatestVersion(TestProjectCreator.AspNetCoreAllPackageName, minorVersion);
internal void ItDoesNotRollForwardToTheLatestVersion(string packageName, string minorVersion)
{
@ -87,13 +84,10 @@ namespace EndToEnd
#endif
}
private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName)
{
return lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier == null)
private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName) => lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier == null)
?.Libraries?.SingleOrDefault(l =>
string.Compare(l.Name, packageName, StringComparison.CurrentCultureIgnoreCase) == 0)
?.Version;
}
public string GetExpectedVersion(string packageName, string minorVersion)
{

View file

@ -92,13 +92,10 @@ namespace EndToEnd
"needs to be updated (see the ImplicitPackageVariable items in MSBuildExtensions.targets in this repo)");
}
private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName)
{
return lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier != null)
private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName) => lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier != null)
?.Libraries?.SingleOrDefault(l =>
string.Compare(l.Name, packageName, StringComparison.CurrentCultureIgnoreCase) == 0)
?.Version;
}
[Fact]
public void WeCoverLatestNetCoreAppRollForward()

View file

@ -191,10 +191,7 @@ namespace EndToEnd.Tests
[InlineData("nunit")]
[InlineData("web")]
[InlineData("mvc")]
public void ItCanBuildTemplates(string templateName, string language = "")
{
TestTemplateCreateAndBuild(templateName, language: language);
}
public void ItCanBuildTemplates(string templateName, string language = "") => TestTemplateCreateAndBuild(templateName, language: language);
/// <summary>
/// The test checks if dotnet new shows curated list correctly after the SDK installation and template insertion.
@ -309,25 +306,16 @@ namespace EndToEnd.Tests
[WindowsOnlyTheory]
[InlineData("wpf")]
[InlineData("winforms")]
public void ItCanBuildDesktopTemplates(string templateName)
{
TestTemplateCreateAndBuild(templateName);
}
public void ItCanBuildDesktopTemplates(string templateName) => TestTemplateCreateAndBuild(templateName);
[WindowsOnlyTheory]
[InlineData("wpf")]
public void ItCanBuildDesktopTemplatesSelfContained(string templateName)
{
TestTemplateCreateAndBuild(templateName, selfContained: true);
}
public void ItCanBuildDesktopTemplatesSelfContained(string templateName) => TestTemplateCreateAndBuild(templateName, selfContained: true);
[Theory]
[InlineData("web")]
[InlineData("console")]
public void ItCanBuildTemplatesSelfContained(string templateName)
{
TestTemplateCreateAndBuild(templateName, selfContained: true);
}
public void ItCanBuildTemplatesSelfContained(string templateName) => TestTemplateCreateAndBuild(templateName, selfContained: true);
/// <summary>
/// The test checks if the template creates the template for correct framework by default.