public void DateTimeValueStorage_AsLong_ReturnsTicks() { DateTime date = DateTime.UtcNow; DateTimeValueStorage storage = new DateTimeValueStorage(date); Assert.Equal(date.Ticks, storage.AsLong); }
public void DateTimeValueStorage_AsAmount_ReturnsTicks() { DateTime date = DateTime.UtcNow; DateTimeValueStorage storage = new DateTimeValueStorage(date); Assert.Equal(date.Ticks, storage.AsAmount.Quantity.ToLong()); }
public void DateTimeValueStorage_Constructor_PopulatesTypeAndValue() { DateTime date = DateTime.UtcNow; DateTimeValueStorage storage = new DateTimeValueStorage(date); Assert.Equal(ValueTypeEnum.DateTime, storage.Type); Assert.Equal(date, storage.Val); }
public void DateTimeValueStorage_Add_SupportsIntegerAndAmount() { DateTime date = new DateTime(2015, 10, 10); DateTimeValueStorage storage1 = new DateTimeValueStorage(date); IntegerValueStorage storage2 = new IntegerValueStorage(1000); Assert.Equal(date.AddSeconds(1000).Ticks, storage1.Add(storage2).AsLong); storage1 = new DateTimeValueStorage(date); AmountValueStorage storage3 = new AmountValueStorage(new Amount(2000)); Assert.Equal(date.AddSeconds(2000).Ticks, storage1.Add(storage3).AsLong); }