Esempio n. 1
0
        public void TestDateTimeVariableNullValue()
        {
            DateTimeVariable var    = new DateTimeVariable();
            bool             actual = var.CheckForStore(null);

            Assert.IsFalse(actual);
        }
Esempio n. 2
0
        public void DateTimeVariableInitialValueTest()
        {
            var dateTime = System.DateTime.Now;
            var variable = new DateTimeVariable(dateTime);

            Assert.AreEqual(dateTime, variable.Value);
        }
Esempio n. 3
0
        public void TestDateTimeValue()
        {
            DateTimeVariable var    = new DateTimeVariable();
            DateTime         actual = new DateTime();

            var.CheckForStore(actual);
            Assert.AreEqual(actual, var.Value);
        }
Esempio n. 4
0
        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));
        }
Esempio n. 6
0
        public void TestGetDateTimeType()
        {
            DateTimeVariable var = new DateTimeVariable();

            Assert.AreEqual("datetime", var.StoreType);
        }
Esempio n. 7
0
        public void TestNotDateTimeStringValue()
        {
            DateTimeVariable var = new DateTimeVariable();

            Assert.IsFalse(var.CheckForStore("not date time string"));
        }
Esempio n. 8
0
        public void TestDateTimeStringValue()
        {
            DateTimeVariable var = new DateTimeVariable();

            Assert.IsTrue(var.CheckForStore("2016-01-01"));
        }
 internal static DateTime?Convert(this DateTimeVariable variable) => variable?.Value;