Skip to content

Commit

Permalink
Update tests for .NET 6
Browse files Browse the repository at this point in the history
  • Loading branch information
dsplaisted committed Oct 26, 2020
1 parent 66318e6 commit 9ec9fce
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion TestAssets/TestProjects/UseCswinrt/consolecswinrt.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
</PropertyGroup>
</Project>
13 changes: 8 additions & 5 deletions src/redist/targets/GenerateBundledVersions.targets
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
<_NETCorePlatformsPackageVersion>$(MicrosoftNETCorePlatformsPackageVersion)</_NETCorePlatformsPackageVersion>

<!-- TODO: Once .NET 5.0 has released, update these version numbers to 5.0.0 -->
<_NET50DefaultRuntimeFrameworkVersion>5.0.0-rc.2.20475.5</_NET50DefaultRuntimeFrameworkVersion>
<_NET50RuntimePackVersion>5.0.0-rc.2.20475.5</_NET50RuntimePackVersion>
<_NET50TargetingPackVersion>5.0.0-rc.2.20475.5</_NET50TargetingPackVersion>
<_WindowsDesktop50DefaultRuntimeFrameworkVersion>5.0.0-rc.2.20475.6</_WindowsDesktop50DefaultRuntimeFrameworkVersion>
<_WindowsDesktop50RuntimePackVersion>5.0.0-rc.2.20475.6</_WindowsDesktop50RuntimePackVersion>
<_WindowsDesktop50TargetingPackVersion>5.0.0-rc.2.20475.6</_WindowsDesktop50TargetingPackVersion>
<_AspNet50DefaultRuntimeFrameworkVersion>5.0.0-rc.2.20475.17</_AspNet50DefaultRuntimeFrameworkVersion>
<_AspNet50RuntimePackVersion>5.0.0-rc.2.20475.17</_AspNet50RuntimePackVersion>
<_AspNet50TargetingPackVersion>5.0.0-rc.2.20475.17</_AspNet50TargetingPackVersion>

Expand Down Expand Up @@ -331,7 +334,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<KnownFrameworkReference Include="Microsoft.NETCore.App"
TargetFramework="net5.0"
RuntimeFrameworkName="Microsoft.NETCore.App"
DefaultRuntimeFrameworkVersion="5.0.0"
DefaultRuntimeFrameworkVersion="$(_NET50DefaultRuntimeFrameworkVersion)"
LatestRuntimeFrameworkVersion="$(_NET50RuntimePackVersion)"
TargetingPackName="Microsoft.NETCore.App.Ref"
TargetingPackVersion="$(_NET50TargetingPackVersion)"
Expand All @@ -357,7 +360,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<KnownFrameworkReference Include="Microsoft.WindowsDesktop.App"
TargetFramework="net5.0"
RuntimeFrameworkName="Microsoft.WindowsDesktop.App"
DefaultRuntimeFrameworkVersion="5.0.0"
DefaultRuntimeFrameworkVersion="$(_WindowsDesktop50DefaultRuntimeFrameworkVersion)"
LatestRuntimeFrameworkVersion="$(_WindowsDesktop50RuntimePackVersion)"
TargetingPackName="Microsoft.WindowsDesktop.App.Ref"
TargetingPackVersion="$(_WindowsDesktop50TargetingPackVersion)"
Expand All @@ -369,7 +372,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<KnownFrameworkReference Include="Microsoft.WindowsDesktop.App.WPF"
TargetFramework="net5.0"
RuntimeFrameworkName="Microsoft.WindowsDesktop.App"
DefaultRuntimeFrameworkVersion="5.0.0"
DefaultRuntimeFrameworkVersion="$(_WindowsDesktop50DefaultRuntimeFrameworkVersion)"
LatestRuntimeFrameworkVersion="$(_WindowsDesktop50RuntimePackVersion)"
TargetingPackName="Microsoft.WindowsDesktop.App.Ref"
TargetingPackVersion="$(_WindowsDesktop50TargetingPackVersion)"
Expand All @@ -382,7 +385,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<KnownFrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms"
TargetFramework="net5.0"
RuntimeFrameworkName="Microsoft.WindowsDesktop.App"
DefaultRuntimeFrameworkVersion="5.0.0"
DefaultRuntimeFrameworkVersion="$(_WindowsDesktop50DefaultRuntimeFrameworkVersion)"
LatestRuntimeFrameworkVersion="$(_WindowsDesktop50RuntimePackVersion)"
TargetingPackName="Microsoft.WindowsDesktop.App.Ref"
TargetingPackVersion="$(_WindowsDesktop50TargetingPackVersion)"
Expand All @@ -395,7 +398,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<KnownFrameworkReference Include="Microsoft.AspNetCore.App"
TargetFramework="net5.0"
RuntimeFrameworkName="Microsoft.AspNetCore.App"
DefaultRuntimeFrameworkVersion="5.0.0"
DefaultRuntimeFrameworkVersion="$(_AspNet50DefaultRuntimeFrameworkVersion)"
LatestRuntimeFrameworkVersion="$(_AspNet50RuntimePackVersion)"
TargetingPackName="Microsoft.AspNetCore.App.Ref"
TargetingPackVersion="$(_AspNet50TargetingPackVersion)"
Expand Down
2 changes: 1 addition & 1 deletion test/EndToEnd/GivenWeWantToRequireWindowsForDesktopApps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void It_does_not_download_desktop_targeting_packs_on_unix()
{
var testProjectCreator = new TestProjectCreator()
{
MinorVersion = "5.0"
MinorVersion = "6.0"
};

testProjectCreator.AdditionalProperties["RestorePackagesPath"] = @"$(MSBuildProjectDirectory)\packages";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace EndToEnd
{
public class GivenWindows50App : TestBase
public class GivenWindowsApp : TestBase
{
[WindowsOnlyTheory]
[InlineData("10.0.17763.0")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,5 @@ public AndConstraint<FileInfoAssertions> NotExist(string because = "", params ob
.FailWith($"Expected File {_fileInfo.FullName} to not exist, but it does.");
return new AndConstraint<FileInfoAssertions>(this);
}

public AndWhichConstraint<FileInfoAssertions, DateTimeOffset> HaveLastWriteTimeUtc(string because = "", params object[] reasonArgs)
{
var lastWriteTimeUtc = _fileInfo.LastWriteTimeUtc;

Execute.Assertion
.ForCondition(lastWriteTimeUtc != null)
.BecauseOf(because, reasonArgs)
.FailWith($"Expected File {_fileInfo.FullName} to have a LastWriteTimeUTC, but it is null.");
return new AndWhichConstraint<FileInfoAssertions, DateTimeOffset>(this, lastWriteTimeUtc);
}
}
}

0 comments on commit 9ec9fce

Please sign in to comment.