예제 #1
0
        private DateTime?GetDateTime(Property property)
        {
            var val = GetFilterValue(property);

            if (val == null)
            {
                return(null);
            }

            return(ParameterHelpers.StringToDate(val.ToString()));
        }
예제 #2
0
        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()));
        }
예제 #3
0
        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);
        }
예제 #4
0
 private DateTime GetDate(Parameter parameter)
 {
     return(ParameterHelpers.StringToDate(this[parameter].ToString()));
 }
예제 #5
0
 internal virtual DateTime FormatDate(string value)
 {
     return(ParameterHelpers.StringToDate(value));
 }