| 78 | // --------------------------------------------------------------------------- |
| 79 | |
| 80 | TEST(operation, method) { |
| 81 | |
| 82 | auto method = OperationMethod::create( |
| 83 | PropertyMap(), std::vector<OperationParameterNNPtr>{}); |
| 84 | EXPECT_TRUE(method->isEquivalentTo(method.get())); |
| 85 | EXPECT_FALSE(method->isEquivalentTo(createUnrelatedObject().get())); |
| 86 | auto otherMethod = OperationMethod::create( |
| 87 | PropertyMap(), |
| 88 | std::vector<OperationParameterNNPtr>{OperationParameter::create( |
| 89 | PropertyMap().set(IdentifiedObject::NAME_KEY, "paramName"))}); |
| 90 | EXPECT_TRUE(otherMethod->isEquivalentTo(otherMethod.get())); |
| 91 | EXPECT_FALSE(method->isEquivalentTo(otherMethod.get())); |
| 92 | auto otherMethod2 = OperationMethod::create( |
| 93 | PropertyMap(), |
| 94 | std::vector<OperationParameterNNPtr>{OperationParameter::create( |
| 95 | PropertyMap().set(IdentifiedObject::NAME_KEY, "paramName2"))}); |
| 96 | EXPECT_FALSE(otherMethod->isEquivalentTo(otherMethod2.get())); |
| 97 | EXPECT_FALSE(otherMethod->isEquivalentTo( |
| 98 | otherMethod2.get(), IComparable::Criterion::EQUIVALENT)); |
| 99 | } |
| 100 | |
| 101 | // --------------------------------------------------------------------------- |
| 102 |
nothing calls this directly
no test coverage detected