public void TestDateTimeVariableNullValue() { DateTimeVariable var = new DateTimeVariable(); bool actual = var.CheckForStore(null); Assert.IsFalse(actual); }
public void DateTimeVariableInitialValueTest() { var dateTime = System.DateTime.Now; var variable = new DateTimeVariable(dateTime); Assert.AreEqual(dateTime, variable.Value); }
public void TestDateTimeValue() { DateTimeVariable var = new DateTimeVariable(); DateTime actual = new DateTime(); var.CheckForStore(actual); Assert.AreEqual(actual, var.Value); }
public void DateTimeVariableChangeValueTest() { var variable = new DateTimeVariable(System.DateTime.Now); var newDateTime = System.DateTime.Parse("1966-07-14"); variable.Value = newDateTime; Assert.AreEqual(newDateTime, variable.Value); }
public void VariableGet_WhenWasNotSet_ReturnsDefaultValue(int year, int month, int day, int hour, int minute, int second) { var defaultValue = new DateTime(year, month, day, hour, minute, second); var variable = new DateTimeVariable("Var", defaultValue); Assert.That(variable.Get(_storage), Is.EqualTo(defaultValue)); }
public void TestGetDateTimeType() { DateTimeVariable var = new DateTimeVariable(); Assert.AreEqual("datetime", var.StoreType); }
public void TestNotDateTimeStringValue() { DateTimeVariable var = new DateTimeVariable(); Assert.IsFalse(var.CheckForStore("not date time string")); }
public void TestDateTimeStringValue() { DateTimeVariable var = new DateTimeVariable(); Assert.IsTrue(var.CheckForStore("2016-01-01")); }
internal static DateTime?Convert(this DateTimeVariable variable) => variable?.Value;