Skip to content

Commit

Permalink
Add tests and fix bug in detection. Fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Feb 6, 2019
1 parent 53c3ad6 commit 2dd745b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
19 changes: 19 additions & 0 deletions OSVersionHelper.Tests/OSVersionHelper.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\OSVersionHelper\OSVersionHelper.csproj" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions OSVersionHelper.Tests/WindowsVersionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using Xunit;

namespace OSVersionHelper.Tests
{
public class WindowsVersionTests
{
[Fact(Skip ="CI")]
public void CurrentVersionReturnsCorrectly()
{
var currentVersion = WindowsVersionHelper.Windows10Release;

Assert.Equal(Windows10Release.October2018, currentVersion);
}
}
}
6 changes: 6 additions & 0 deletions OSVersionHelper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSVersionHelper", "OSVersionHelper\OSVersionHelper.csproj", "{BE6D42CC-DDFA-4EAF-81E3-9953B5D08973}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OSVersionHelper.Tests", "OSVersionHelper.Tests\OSVersionHelper.Tests.csproj", "{F4352F48-C578-460D-B245-E8BD2BC3C334}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -25,6 +27,10 @@ Global
{BE6D42CC-DDFA-4EAF-81E3-9953B5D08973}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE6D42CC-DDFA-4EAF-81E3-9953B5D08973}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE6D42CC-DDFA-4EAF-81E3-9953B5D08973}.Release|Any CPU.Build.0 = Release|Any CPU
{F4352F48-C578-460D-B245-E8BD2BC3C334}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4352F48-C578-460D-B245-E8BD2BC3C334}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4352F48-C578-460D-B245-E8BD2BC3C334}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4352F48-C578-460D-B245-E8BD2BC3C334}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion OSVersionHelper/WindowsVersionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static WindowsVersionHelper()
{
Windows10Release = Windows10Release.October2018;
}
if (IsApiContractPresent(6))
else if (IsApiContractPresent(6))
{
Windows10Release = Windows10Release.April2018;
}
Expand Down

0 comments on commit 2dd745b

Please sign in to comment.