Example #1
0
        public void Test_IResolvableToValue_ResolveToValue()
        {
            //---------------Set up test pack-------------------
            DateTimeToday dateTimeToday = new DateTimeToday();
            IResolvableToValue <DateTime> resolvableToValue = dateTimeToday;
            DateTime today = DateTime.Today;
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            object resolvedValue = resolvableToValue.ResolveToValue();
            //---------------Test Result -----------------------
            DateTime dateTime = TestUtil.AssertIsInstanceOf <DateTime>(resolvedValue);

            Assert.AreEqual(today, dateTime);
        }
Example #2
0
        public void Test_IResolvableToValue_ResolveToValue()
        {
            //---------------Set up test pack-------------------
            DateTimeNow        dateTimeNow       = new DateTimeNow();
            IResolvableToValue resolvableToValue = dateTimeNow;
            DateTime           dateTimeBefore    = DateTime.Now;
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            object resolvedValue = resolvableToValue.ResolveToValue();
            //---------------Test Result -----------------------
            DateTime dateTimeAfter = DateTime.Now;
            DateTime dateTime      = TestUtil.AssertIsInstanceOf <DateTime>(resolvedValue);

            Assert.GreaterOrEqual(dateTime, dateTimeBefore);
            Assert.LessOrEqual(dateTime, dateTimeAfter);
        }