Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Removing DateTime test. Bad test: relies on local time zone and doesn…
Browse files Browse the repository at this point in the history
…t test much
  • Loading branch information
John Kordich committed Jun 28, 2016
1 parent 786c521 commit 8b374c1
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,25 +466,6 @@ public void Properties_Add_ValueAndType_DateTime_DateTime_MaxValue()
Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
}

[Fact]
public void Properties_Add_ValueAndType_DateTime_DateTime_AlmostMaxValue()
{
DateTime maxValidCimTimestampUtc = new DateTime(3155378975999999990, DateTimeKind.Utc);
DateTime maxValidCimTimestampLocal = TimeZoneInfo.ConvertTime(maxValidCimTimestampUtc, TimeZoneInfo.Local);

DateTime myDate = DateTime.MaxValue.Subtract(TimeSpan.FromSeconds(1));
CimInstance cimInstance = new CimInstance("MyClassName");
CimProperty cimProperty = CimProperty.Create("MyPropertyName", myDate, CimType.DateTime, CimFlags.None);
cimInstance.CimInstanceProperties.Add(cimProperty);

CimProperty addedProperty = cimInstance.CimInstanceProperties.Single();
Assert.NotNull(addedProperty.Value, "addedProperty.Value is null");
Assert.True(addedProperty.Value is DateTime, "addedProperty.Value.GetType() is not correct");
DateTime value = (DateTime)addedProperty.Value;
Assert.Equal(maxValidCimTimestampLocal.Ticks, value.Ticks, "addedProperty.Value is not correct");
Assert.Equal(CimType.DateTime, addedProperty.CimType, "addedProperty.CimType is not correct");
}

[Fact]
public void Properties_Add_ValueAndType_DateTime_TimeSpan_InTicks()
{
Expand Down

0 comments on commit 8b374c1

Please sign in to comment.