mirror of
https://github.com/tiennm99/time-mocker.git
synced 2026-10-13 02:14:56 +00:00
feat: cleanup
This commit is contained in:
1 parent
8ec41ab1d2
commit
77f45bd23c
6 files changed
+20
-32
No files matched your search
@@ -15,7 +15,6 @@ namespace TimeMocker.Hook
|
||||
public struct MockTimeInfo
|
||||
{
|
||||
public long DeltaTicks; // Offset to add to DateTime.UtcNow.Ticks (can be negative)
|
||||
public int Enabled; // 1 = mock active, 0 = passthrough
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -108,12 +107,8 @@ namespace TimeMocker.Hook
|
||||
private DateTime GetFakeUtc()
|
||||
{
|
||||
var info = ReadMockInfo();
|
||||
if (info.Enabled == 1)
|
||||
{
|
||||
// Return real UTC time plus the stored delta offset
|
||||
return new DateTime(DateTime.UtcNow.Ticks + info.DeltaTicks, DateTimeKind.Utc);
|
||||
}
|
||||
return DateTime.UtcNow;
|
||||
// Return real UTC time plus the stored delta offset
|
||||
return new DateTime(DateTime.UtcNow.Ticks + info.DeltaTicks, DateTimeKind.Utc);
|
||||
}
|
||||
|
||||
private void InstallHooks()
|
||||
|
||||
Reference in new issue
Block a user