Skip to content

Commit a678c73

Browse files
committed
🌍 #1 Set up new test project, so that we can test ourselves silly
1 parent aac1118 commit a678c73

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

GalaxyCheck.sln

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1414
nuget.config = nuget.config
1515
EndProjectSection
1616
EndProject
17+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GalaxyCheck.Tests.V2", "tests\GalaxyCheck.Tests.V2\GalaxyCheck.Tests.V2.csproj", "{23BD4F58-8216-4F26-894C-F43289B7BDDA}"
18+
EndProject
1719
Global
1820
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1921
Debug|Any CPU = Debug|Any CPU
@@ -32,6 +34,10 @@ Global
3234
{5CB4593A-D9E0-484A-A0AA-EAD7788C71E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
3335
{5CB4593A-D9E0-484A-A0AA-EAD7788C71E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
3436
{5CB4593A-D9E0-484A-A0AA-EAD7788C71E3}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{23BD4F58-8216-4F26-894C-F43289B7BDDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{23BD4F58-8216-4F26-894C-F43289B7BDDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{23BD4F58-8216-4F26-894C-F43289B7BDDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{23BD4F58-8216-4F26-894C-F43289B7BDDA}.Release|Any CPU.Build.0 = Release|Any CPU
3541
EndGlobalSection
3642
GlobalSection(SolutionProperties) = preSolution
3743
HideSolutionNode = FALSE

nuget.config

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<configuration>
33
<packageSources>
44
<clear />
5+
<add key="myget" value="https://www.myget.org/F/galaxy-check/api/v3/index.json" />
56
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
67
</packageSources>
78
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
<LangVersion>9.0</LangVersion>
6+
<IsPackable>false</IsPackable>
7+
<RootNamespace>Tests.V2</RootNamespace>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
13+
<PackageReference Include="NebulaCheck" Version="0.0.0-588529370" />
14+
<PackageReference Include="xunit" Version="2.4.1" />
15+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
16+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17+
<PrivateAssets>all</PrivateAssets>
18+
</PackageReference>
19+
<PackageReference Include="coverlet.collector" Version="1.3.0">
20+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
21+
<PrivateAssets>all</PrivateAssets>
22+
</PackageReference>
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<ProjectReference Include="..\..\src\GalaxyCheck\GalaxyCheck.csproj" />
27+
</ItemGroup>
28+
29+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using NebulaCheck;
2+
using Xunit;
3+
using Rng = GalaxyCheck.Internal.Random.Rng;
4+
5+
namespace Tests.V2.RandomTests
6+
{
7+
public class AboutCreate
8+
{
9+
[Fact]
10+
public void ItIsRepeatable()
11+
{
12+
var checkResult = Gen
13+
.Int32()
14+
.NoShrink()
15+
.ForAll(seed =>
16+
{
17+
var rng0 = Rng.Create(seed);
18+
var rng1 = Rng.Create(seed);
19+
20+
Assert.Equal(rng0, rng1);
21+
})
22+
.Check();
23+
24+
Assert.False(checkResult.Falsified);
25+
}
26+
27+
[Fact]
28+
public void ItInitializesTheOrder()
29+
{
30+
var checkResult = Gen
31+
.Int32()
32+
.NoShrink()
33+
.ForAll(seed =>
34+
{
35+
var rng = Rng.Create(seed);
36+
37+
Assert.Equal(0, rng.Order);
38+
})
39+
.Check();
40+
41+
Assert.False(checkResult.Falsified);
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)