Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 29, 2023
1 parent 6de723b commit f78a239
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/Verify/Counter_Date.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public string NextString(Date input) =>
{
var value = Interlocked.Increment(ref currentDate);
if (!dateCounting)
if (dateCounting)
{
return (value, "{Scrubbed}");
return (value, $"Date_{value}");
}
return (value, $"Date_{value}");
return (value, "{Scrubbed}");
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Verify/Counter_DateTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public string NextString(DateTime input) =>
{
var value = Interlocked.Increment(ref currentDateTime);
if (!dateCounting)
if (dateCounting)
{
return (value, "{Scrubbed}");
return (value, $"DateTime_{value}");
}
return (value, $"DateTime_{value}");
return (value, "{Scrubbed}");
});
}
}
6 changes: 3 additions & 3 deletions src/Verify/Counter_DateTimeOffset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ public string NextString(DateTimeOffset input) =>
{
var value = Interlocked.Increment(ref currentDateTimeOffset);
if (!dateCounting)
if (dateCounting)
{
return (value, "{Scrubbed}");
return (value, $"DateTimeOffset_{value}");
}
return (value, $"DateTimeOffset_{value}");
return (value, "{Scrubbed}");
});
}
}
12 changes: 7 additions & 5 deletions src/Verify/Counter_Guid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ public string NextString(Guid input) =>
return new(0, name);
}

return guidCache.GetOrAdd(input, _ =>
{
var value = Interlocked.Increment(ref currentGuid);
return (value, $"Guid_{value}");
});
return guidCache.GetOrAdd(
input,
_ =>
{
var value = Interlocked.Increment(ref currentGuid);
return (value, $"Guid_{value}");
});
}
}
12 changes: 7 additions & 5 deletions src/Verify/Counter_Time.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ public string NextString(Time input) =>
return new(0, name);
}

return timeCache.GetOrAdd(input, _ =>
{
var value = Interlocked.Increment(ref currentTime);
return (value, $"Time_{value}");
});
return timeCache.GetOrAdd(
input,
_ =>
{
var value = Interlocked.Increment(ref currentTime);
return (value, $"Time_{value}");
});
}
}
#endif

0 comments on commit f78a239

Please sign in to comment.