Written by

Question Andy Blake · Jun 30, 2021

UnitTest Assertion on a stringc

Hi, I need to assert that a string is a certain value.

$$$AssertEquals("String value""Value expected""Should return correct value")

When running this I get an INVALID OREF error.

Is there any Assertion method I can use where the first parameter can be string like above, rather than an instance of a class as I can see on the documentation?

Thanks,

Andy.

Product version: Caché 2018.1

Comments

Eduard Lebedyuk · Jun 30, 2021

Asserts work on a string, here's an example.

Can you post a minimal example which causes INVALID OREF error?

0
Sergei Shutov · Jul 5, 2021

I believe this error happen because you are trying to execute this code in the class method, not instance method.

Can you please provide a full class definition and how you are executing the test?

0