Erweiterung der UnitTests und kleinere Fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AMWD.Common.Tests.Utils;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace AMWD.Common.Tests.Extensions
|
||||
@@ -10,6 +11,9 @@ namespace AMWD.Common.Tests.Extensions
|
||||
public void ShouldReturnUtc()
|
||||
{
|
||||
// arrange
|
||||
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Europe/Berlin");
|
||||
using var mock = TimeZoneInfoLocalMock.Create(timeZoneInfo);
|
||||
|
||||
var utc = new DateTime(2021, 11, 15, 11, 22, 33, DateTimeKind.Utc);
|
||||
var local = new DateTime(2021, 11, 15, 11, 22, 33, DateTimeKind.Local);
|
||||
var unspecified = new DateTime(2021, 11, 15, 11, 22, 33, DateTimeKind.Unspecified);
|
||||
@@ -33,6 +37,9 @@ namespace AMWD.Common.Tests.Extensions
|
||||
public void ShouldReturnLocal()
|
||||
{
|
||||
// arrange
|
||||
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Europe/Berlin");
|
||||
using var mock = TimeZoneInfoLocalMock.Create(timeZoneInfo);
|
||||
|
||||
var utc = new DateTime(2021, 11, 15, 11, 22, 33, DateTimeKind.Utc);
|
||||
var local = new DateTime(2021, 11, 15, 11, 22, 33, DateTimeKind.Local);
|
||||
var unspecified = new DateTime(2021, 11, 15, 11, 22, 33, DateTimeKind.Unspecified);
|
||||
@@ -122,6 +129,9 @@ namespace AMWD.Common.Tests.Extensions
|
||||
public void ShouldReturnCorrectLocalAlignmentDaylightSavingEnd()
|
||||
{
|
||||
// arrange
|
||||
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Europe/Berlin");
|
||||
using var mock = TimeZoneInfoLocalMock.Create(timeZoneInfo);
|
||||
|
||||
var utcNow = new DateTime(2021, 10, 30, 12, 15, 30, 45, DateTimeKind.Local);
|
||||
|
||||
var intervalThreeSeconds = TimeSpan.FromSeconds(3);
|
||||
@@ -155,6 +165,9 @@ namespace AMWD.Common.Tests.Extensions
|
||||
public void ShouldReturnCorrectLocalAlignmentDaylightSavingStart()
|
||||
{
|
||||
// arrange
|
||||
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Europe/Berlin");
|
||||
using var mock = TimeZoneInfoLocalMock.Create(timeZoneInfo);
|
||||
|
||||
var utcNow = new DateTime(2022, 3, 26, 12, 15, 30, 45, DateTimeKind.Local);
|
||||
|
||||
var intervalThreeSeconds = TimeSpan.FromSeconds(3);
|
||||
|
||||
Reference in New Issue
Block a user