Example #1
0
        public void GetValueDateTimeIsNull2()
        {
            Type   type  = typeof(DateTime?);
            string value = "ABCDEF123";

            var actual = RedisHelpers.GetValue(type, value);

            Assert.IsNull(actual);
        }
Example #2
0
        public void GetValueEnumIsNull2()
        {
            Type   type  = typeof(TestStatus);
            string value = "ABC#$";

            var actual = RedisHelpers.GetValue(type, value);

            Assert.IsNull(actual);
        }
Example #3
0
        public void GetValueInt64IsNull2()
        {
            Type   type  = typeof(long?);
            string value = "ABC123";

            var actual = RedisHelpers.GetValue(type, value);

            Assert.Null(actual);
        }
Example #4
0
        public void GetValueInt32IsNull()
        {
            Type   type  = typeof(int?);
            string value = null;

            var actual = RedisHelpers.GetValue(type, value);

            Assert.Null(actual);
        }
Example #5
0
        public void GetValueEnumIsValid()
        {
            Type   type     = typeof(TestStatus);
            string value    = "1";
            var    expected = TestStatus.Running;

            var actual = RedisHelpers.GetValue(type, value);

            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void GetValueGUIDIsEmpty2()
        {
            Type   type     = typeof(Guid);
            string value    = "";
            var    expected = Guid.Empty;

            var actual = RedisHelpers.GetValue(type, value);

            Assert.AreEqual(expected, actual);
        }
Example #7
0
        public void GetValueGUIDIsValid()
        {
            Type   type     = typeof(Guid);
            string value    = "c5adb885-04a3-4b9d-861d-13e4c7669d0b";
            var    expected = Guid.Parse(value);

            var actual = RedisHelpers.GetValue(type, value);

            Assert.AreEqual(expected, actual);
        }
Example #8
0
        public void GetValueDateTimeValid()
        {
            Type   type     = typeof(DateTime?);
            string value    = "1/1/2017 12:00:00";
            var    expected = DateTime.Parse(value);

            var actual = RedisHelpers.GetValue(type, value);

            Assert.AreEqual(expected, actual);
        }
Example #9
0
        public void GetValueInt64Valid()
        {
            Type   type     = typeof(long?);
            string value    = "123";
            var    expected = long.Parse(value);

            var actual = RedisHelpers.GetValue(type, value);

            Assert.Equal(expected, actual);
        }