public string DateProperty_Structure_DateTime_Succeed()
        {
            DateTime startTime = new DateTime(2020, 1, 12);
            DateTime endTime   = new DateTime(2020, 3, 22);

            DateProperty property = new DateProperty(startTime, endTime);

            return(property.ToString());
        }
        public string DateProperty_DateTime_Succeed(bool hasStart, bool hasEnd)
        {
            DateProperty property = new DateProperty();

            if (hasStart)
            {
                property.startDate = new DateTime(2020, 1, 12);
            }

            if (hasEnd)
            {
                property.endDate = new DateTime(2020, 3, 22);
            }

            return(property.ToString());
        }
Esempio n. 3
0
        internal override bool Matches(DirectoryEntry de)
        {
            // If it has no SID, it's not a security principal, and we're not interested in it.
            // (In reg-SAM, computers don't have accounts and therefore don't have SIDs, but ADSI
            // creates fake Computer objects for them.  In LSAM, computers CAN have accounts, and thus
            // SIDs).
            if (de.Properties["objectSid"] == null || de.Properties["objectSid"].Count == 0)
            {
                GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMQuerySet", "FindByDateMatcher: Matches: skipping no-SID {0}", de.Path);
                return(false);
            }

            switch (_propertyToMatch)
            {
            case DateProperty.LogonTime:
                return(MatchOnLogonTime(de));

            case DateProperty.PasswordSetTime:
                return(MatchOnPasswordSetTime(de));

            case DateProperty.AccountExpirationTime:
                return(MatchOnAccountExpirationTime(de));

            default:
                Debug.Fail("FindByDateMatcher.Matches: Fell off end looking for propertyToMatch=" + _propertyToMatch.ToString());
                return(false);
            }
        }
Esempio n. 4
0
 public override string ToString()
 {
     return($"{StringProperty ?? "<null>"};{IntegerProperty};{GuidProperty};{UriProperty};{DateProperty.ToString(COMPARISON_DATE_FORMAT, CultureInfo.InvariantCulture)};{Select};{BooleanProperty};{string.Format("{0:0.000}",DecimalProperty)};{FloatProperty};{RandomProperty ?? "<null>"}");
 }
        public string DateProperty_Structure_String_Succeed(string startTime, string endTime)
        {
            DateProperty property = new DateProperty(startTime, endTime);

            return(property.ToString());
        }