Skip to content

Commit 9fec0a8

Browse files
author
Bart Koelman
committed
Fixed: make faker dates deterministic
See https://giters.com/bchavez/Bogus/issues/247
1 parent 834594a commit 9fec0a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/TestBuildingBlocks/FakerContainer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
using System.Diagnostics;
33
using System.Linq;
44
using System.Reflection;
5+
using Bogus.DataSets;
6+
using FluentAssertions.Extensions;
57
using Xunit;
68

79
namespace TestBuildingBlocks
810
{
911
public abstract class FakerContainer
1012
{
13+
static FakerContainer()
14+
{
15+
Date.SystemClock = () => 1.January(2020);
16+
}
17+
1118
protected static int GetFakerSeed()
1219
{
1320
// The goal here is to have stable data over multiple test runs, but at the same time different data per test case.

0 commit comments

Comments
 (0)