public void TryGetValue() { var actual = new object(); var check = new object(); var equalityComparer = new CustomEqualityComparer <object>(FuncHelper.GetTautologyFunc <object, object>(), _ => 0); var hashSet = new HashSetEx <object>(equalityComparer) { actual }; var test = hashSet.TryGetValue(check, out var found); Assert.IsTrue(test); Assert.AreSame(actual, found); Assert.AreNotSame(check, found); }
public ConditionalExtendedEnumerable(IEnumerable <T> target, IEnumerable <T> append, Func <bool> enumerateTarget, Func <bool> enumerateAppend) : base(target, append) { if (enumerateTarget == null) { throw new ArgumentNullException("enumerateTarget"); } _enumerateTarget = enumerateTarget; _enumerateAppend = enumerateAppend ?? (null == append ? FuncHelper.GetFallacyFunc() : FuncHelper.GetTautologyFunc()); }
public ConditionalExtendedList(IEnumerable <T> target, IEnumerable <T> append, Func <bool> enumerateTarget, Func <bool> enumerateAppend) { _target = target == null?ArrayEx.Empty <T>() : target.WrapAsIList(); _append = append == null?ArrayEx.Empty <T>() : append.WrapAsIList(); _enumerateTarget = enumerateTarget ?? (target == null ? FuncHelper.GetFallacyFunc() : FuncHelper.GetTautologyFunc()); _enumerateAppend = enumerateAppend ?? (append == null ? FuncHelper.GetFallacyFunc() : FuncHelper.GetTautologyFunc()); }
public ConditionalExtendedList(IEnumerable <T> target, IEnumerable <T> append, Func <bool> enumerateTarget, Func <bool> enumerateAppend) { _target = target == null ? ArrayReservoir <T> .EmptyArray : Extensions.WrapAsIList(target); _append = append == null ? ArrayReservoir <T> .EmptyArray : Extensions.WrapAsIList(append); _enumerateTarget = enumerateTarget ?? (null == target ? FuncHelper.GetFallacyFunc() : FuncHelper.GetTautologyFunc()); _enumerateAppend = enumerateAppend ?? (null == append ? FuncHelper.GetFallacyFunc() : FuncHelper.GetTautologyFunc()); }
public ConditionalExtendedEnumerable(IEnumerable <T> target, IEnumerable <T> append, Func <bool> enumerateTarget, Func <bool> enumerateAppend) : base(target, append) { _enumerateTarget = Check.NotNullArgument(enumerateTarget, "enumerateTarget"); _enumerateAppend = enumerateAppend ?? (null == append ? FuncHelper.GetFallacyFunc() : FuncHelper.GetTautologyFunc()); }