func testGetOperator()

in FBAEMKit/FBAEMKitTests/AEMAdvertiserRuleFactoryTests.swift [164:275]


  func testGetOperator() {
    XCTAssertEqual(
      factory.getOperator(["test_key": "abc"]),
      .unknown,
      "Should get the expected Unknown operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["And": "abc"]),
      .and,
      "Should get the expected AND operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["and": "abc"]),
      .and,
      "Should get the expected AND operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["or": "abc"]),
      .or,
      "Should get the expected OR operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["not": "abc"]),
      .not,
      "Should get the expected NOT operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["contains": "abc"]),
      .contains,
      "Should get the expected Contains operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["not_contains": "abc"]),
      .notContains,
      "Should get the expected NotContains operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["starts_with": "abc"]),
      .startsWith,
      "Should get the expected StartsWith operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["i_contains": "abc"]),
      .caseInsensitiveContains,
      "Should get the expected i_contains operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["i_not_contains": "abc"]),
      .caseInsensitiveNotContains,
      "Should get the expected I_NotContains operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["i_starts_with": "abc"]),
      .caseInsensitiveStartsWith,
      "Should get the expected I_StartsWith operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["regex_match": "abc"]),
      .regexMatch,
      "Should get the expected REGEX_MATCH operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["eq": "abc"]),
      .equal,
      "Should get the expected EQ operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["neq": "abc"]),
      .notEqual,
      "Should get the expected NEQ operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["lt": 10]),
      .lessThan,
      "Should get the expected LT operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["lte": 10]),
      .lessThanOrEqual,
      "Should get the expected LTE operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["gt": 10]),
      .greaterThan,
      "Should get the expected GT operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["gte": 10]),
      .greaterThanOrEqual,
      "Should get the expected GTE operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["i_is_any": ["abc"]]),
      .caseInsensitiveIsAny,
      "Should get the expected I_IsAny operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["i_is_not_any": ["abc"]]),
      .caseInsensitiveIsNotAny,
      "Should get the expected I_IsNotAny operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["is_any": ["abc"]]),
      .isAny,
      "Should get the expected IsAny operator of the dictionary"
    )
    XCTAssertEqual(
      factory.getOperator(["is_not_any": ["abc"]]),
      .isNotAny,
      "Should get the expected IsNotAny operator of the dictionary"
    )
  }