static IEnumerable <SearcherItem> GetOperatorsFromType(Type type) { // We cannot support all the types because of PropertyFields (see ConstantEditorExtensions) // that is drawn to represent Criterion type if (!type.IsEnum && !k_SupportedTypes.Contains(type)) { return(Enumerable.Empty <SearcherItem>()); } return(TypeSystem.GetOverloadedBinaryOperators(type) .Where(k => k_SupportedOperators.Contains(k)) .Select(o => new CriterionSearcherItem(o))); }
public void TestGetOverloadedBinaryOperators_NoOverload(Type type) { Assert.IsFalse(TypeSystem.GetOverloadedBinaryOperators(type).Any()); }
public void TestGetOverloadedBinaryOperators_GetKind() { Assert.AreEqual(TypeSystem.GetOverloadedBinaryOperators(typeof(FakeBinaryOverload)).First(), BinaryOperatorKind.Add); }
public void GetOverloadedBinaryOperators(Type type) { Assert.IsTrue(TypeSystem.GetOverloadedBinaryOperators(type).Any()); }
public SearcherFilter WithBinaryOperators(Type type) { this.RegisterBinaryOperator(data => TypeSystem.GetOverloadedBinaryOperators(type).Contains(data.Kind)); return(this); }