-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
173 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/Cake.Unity.FSharp.Tests/Cake.Unity.FSharp.Tests.fsproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net46</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FsUnit" Version="3.4.0" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="UnityVersionTests.fs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Cake.Unity\Cake.Unity.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Update="System.ValueTuple" Version="4.5.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module UnityVersionTests | ||
|
||
open FsUnit.TopLevelOperators | ||
open NUnit.Framework | ||
open Cake.Unity.Version | ||
|
||
let stage (version : UnityVersion) = version.Stage | ||
|
||
[<Test>] | ||
let ``Unity version with 'a' suffix should be in Alpha stage`` () = | ||
(2019, 1, 0, 'a', 9) |> UnityVersion |> stage |> should equal UnityReleaseStage.Alpha | ||
|
||
[<Test>] | ||
let ``Unity version with 'b' suffix should be in Beta stage`` () = | ||
(2018, 3, 0, 'b', 2) |> UnityVersion |> stage |> should equal UnityReleaseStage.Beta | ||
|
||
[<Test>] | ||
let ``Unity version with 'p' suffix should be in Patch stage`` () = | ||
(2017, 2, 2, 'p', 1) |> UnityVersion |> stage |> should equal UnityReleaseStage.Patch | ||
|
||
[<Test>] | ||
let ``Unity version with 'f' suffix should be in Final stage`` () = | ||
(2018, 2, 20, 'f', 1) |> UnityVersion |> stage |> should equal UnityReleaseStage.Final | ||
|
||
[<Test>] | ||
let ``Unity version without suffix should be in Unknown stage`` () = | ||
(2018, 4, 13) |> UnityVersion |> stage |> should equal UnityReleaseStage.Unknown | ||
|
||
[<Test>] | ||
let ``Unity version with unknown suffix should be in Unknown stage`` () = | ||
(2022, 2, 2, 'x', 2) |> UnityVersion |> stage |> should equal UnityReleaseStage.Unknown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using Cake.Core.IO; | ||
using Cake.Unity.Version; | ||
|
||
namespace Cake.Unity | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Cake.Unity.Version | ||
{ | ||
public enum UnityReleaseStage | ||
{ | ||
Alpha = -100, | ||
Beta = -10, | ||
Unknown = 0, | ||
Patch = 10, | ||
Final = 100, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters