Skip to content

Commit de2fcb2

Browse files
committed
Update console projects to net50 and fix Test
1 parent 0330f55 commit de2fcb2

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/Benchmark/Benchmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<Authors>Andreas Beham</Authors>
77
<Version>3.4</Version>
88
<Company>HEAL, FH Upper Austria</Company>

src/Samples/Samples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<Version>3.4</Version>
77
<Authors>Andreas Beham</Authors>
88
<Company>HEAL, FH Upper Austria</Company>

src/Tests/EnvironmentTests.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,21 @@ public void EnvironmentBackwardsCompat() {
170170

171171
[Fact]
172172
public void PseudoRealtimeEnvTestStopTest() {
173-
var then = DateTime.UtcNow;
173+
var sw = Stopwatch.StartNew();
174174
var env = new PseudoRealtimeSimulation();
175175
env.Run(TimeSpan.FromSeconds(1));
176-
var now = DateTime.UtcNow;
177-
Assert.True(now - then >= TimeSpan.FromSeconds(1));
176+
sw.Stop();
177+
Assert.True(sw.Elapsed >= TimeSpan.FromSeconds(1));
178178

179-
then = DateTime.UtcNow;
179+
sw.Restart();
180+
var simTime = env.Now;
180181
var t = Task.Run(() => env.Run(TimeSpan.FromMinutes(1)));
181182
Task.Delay(TimeSpan.FromMilliseconds(200)).Wait();
182183
env.StopAsync();
183184
t.Wait();
184-
now = DateTime.UtcNow;
185-
Assert.True(now - then < TimeSpan.FromMinutes(1));
185+
sw.Stop();
186+
// probably safe to assume this didn't take longer than 10s
187+
Assert.True(env.Now - simTime < TimeSpan.FromSeconds(10));
186188
}
187189

188190
[Fact]

src/Tests/Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<Version>3.4</Version>
77
<Authors>Andreas Beham</Authors>
88
<Company>HEAL, FH Upper Austria</Company>

0 commit comments

Comments
 (0)