|
17 | 17 | import XCTest |
18 | 18 | @testable import ObjectBox |
19 | 19 |
|
| 20 | +/// Tests property queries, so those created from a regular query with `Query.property()`. |
20 | 21 | class PropertyQueryTests: XCTestCase { |
21 | 22 |
|
22 | 23 | var store: Store! |
@@ -460,50 +461,5 @@ class PropertyQueryTests: XCTestCase { |
460 | 461 | let uniqueResult = try propertyQuery.findUniqueString()! |
461 | 462 | XCTAssertEqual(uniqueResult, "hold me tight") |
462 | 463 | } |
463 | | - |
464 | | - // MARK: - ByteVector |
465 | | - |
466 | | - func testByteVectorQueries() throws { |
467 | | - let firstBytes = Data("CAROLSHAW".utf8) |
468 | | - let secondBytes = Data("EVELYNBOYDGRANVILLE".utf8) |
469 | | - let thirdBytes = Data("MARYKENNETHKELLER".utf8) |
470 | | - let entity1 = NullablePropertyEntity(byteVector: firstBytes) |
471 | | - let entity2 = NullablePropertyEntity(maybeByteVector: firstBytes, byteVector: secondBytes) |
472 | | - let entity3 = NullablePropertyEntity(maybeByteVector: secondBytes, byteVector: thirdBytes) |
473 | | - try box.put([entity1, entity2, entity3]) |
474 | | - |
475 | | - XCTAssertEqual(try box.query({ |
476 | | - NullablePropertyEntity.maybeByteVector.isNil() |
477 | | - }).build().find().count, 1) |
478 | | - |
479 | | - XCTAssertEqual(try box.query({ |
480 | | - NullablePropertyEntity.maybeByteVector.isNotNil() |
481 | | - }).build().find().count, 2) |
482 | | - |
483 | | - let queryEqual = try box.query({ NullablePropertyEntity.maybeByteVector == secondBytes }).build() |
484 | | - XCTAssertEqual(try queryEqual.findUnique()!.id, entity3.id) |
485 | | - queryEqual.setParameter(NullablePropertyEntity.maybeByteVector, to: firstBytes) |
486 | | - XCTAssertEqual(try queryEqual.findUnique()!.id, entity2.id) |
487 | | - |
488 | | - XCTAssertEqual(try box.query({ |
489 | | - NullablePropertyEntity.maybeByteVector < secondBytes |
490 | | - }).build().find().count, 1) |
491 | | - |
492 | | - XCTAssertEqual(try box.query({ |
493 | | - NullablePropertyEntity.maybeByteVector > firstBytes |
494 | | - }).build().find().count, 1) |
495 | | - |
496 | | - XCTAssertEqual(try box.query({ |
497 | | - NullablePropertyEntity.byteVector == secondBytes |
498 | | - }).build().find().count, 1) |
499 | | - |
500 | | - XCTAssertEqual(try box.query({ |
501 | | - NullablePropertyEntity.byteVector < firstBytes |
502 | | - }).build().find().count, 0) |
503 | | - |
504 | | - XCTAssertEqual(try box.query({ |
505 | | - NullablePropertyEntity.byteVector > firstBytes |
506 | | - }).build().find().count, 2) |
507 | | - } |
508 | 464 |
|
509 | 465 | } |
0 commit comments