private DateTime?GetDateTime(Property property) { var val = GetFilterValue(property); if (val == null) { return(null); } return(ParameterHelpers.StringToDate(val.ToString())); }
private DateTime?GetDateTime(Property property) { var val = GetFilterValue(property); if (val == null) { return(null); } if (val is DateTime) { return((DateTime?)val); } //We're retrieving a DateTime we serialized previously return(ParameterHelpers.StringToDate(val.ToString())); }
public void SystemInfo_Software_PropertiesMapCorrectly() { var name = "\"Name\""; var vendor = "\"Vendor\""; var version = "1.2"; var date = "\"2017-05-23-00-00-00\""; var size = "1234"; var displayName = "\"DisplayName\""; var obj = GetSystemInfoResponse <DeviceSoftwareInfo>( SystemInfoItem.SoftwareItem(name, vendor, version, date, size, displayName) ); AssertAreEqual(name, obj.Name); AssertAreEqual(vendor, obj.Vendor); AssertAreEqual(Version.Parse(version), obj.Version); AssertAreEqual(ParameterHelpers.StringToDate(date.Trim('"')), obj.InstallDate); AssertAreEqual(Convert.ToInt32(size), obj.Size); AssertAreEqual(displayName, obj.DisplayName); }
private DateTime GetDate(Parameter parameter) { return(ParameterHelpers.StringToDate(this[parameter].ToString())); }
internal virtual DateTime FormatDate(string value) { return(ParameterHelpers.StringToDate(value)); }