public void GetValueDateTimeIsNull2() { Type type = typeof(DateTime?); string value = "ABCDEF123"; var actual = RedisHelpers.GetValue(type, value); Assert.IsNull(actual); }
public void GetValueEnumIsNull2() { Type type = typeof(TestStatus); string value = "ABC#$"; var actual = RedisHelpers.GetValue(type, value); Assert.IsNull(actual); }
public void GetValueInt64IsNull2() { Type type = typeof(long?); string value = "ABC123"; var actual = RedisHelpers.GetValue(type, value); Assert.Null(actual); }
public void GetValueInt32IsNull() { Type type = typeof(int?); string value = null; var actual = RedisHelpers.GetValue(type, value); Assert.Null(actual); }
public void GetValueEnumIsValid() { Type type = typeof(TestStatus); string value = "1"; var expected = TestStatus.Running; var actual = RedisHelpers.GetValue(type, value); Assert.AreEqual(expected, actual); }
public void GetValueGUIDIsEmpty2() { Type type = typeof(Guid); string value = ""; var expected = Guid.Empty; var actual = RedisHelpers.GetValue(type, value); Assert.AreEqual(expected, actual); }
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); }
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); }
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); }