public void ToString_should_return_expected_result(long value, string expectedResult) { var subject = new BsonTimestamp(value); var result = subject.ToString(); result.Should().Be(expectedResult); }
public static DateTime ConvertToDateTime(this BsonTimestamp Id) { DateTime dtStart = TimeZoneInfo.ConvertTime(new DateTime(1970, 1, 1, 8, 0, 0, 0), TimeZoneInfo.Local); long lTime = long.Parse(Id.ToString() + "0000000"); TimeSpan toNow = new TimeSpan(lTime); return(dtStart.Add(toNow)); }
public void ToString_should_return_expected_result(long value, string expectedResult) { var subject = new BsonTimestamp(value); var result = subject.ToString(); result.Should().Be(expectedResult); }