Pregunta

Inside Fitnesse DoFixture, you can use check keyword to compare one of the objects with an expected value. I was wondering if there is a check not equal that exists to make sure the expected and actual do not match up.

I have tried using that set of keywords but it is not supported. There is a reject keyword for DoFixtures, but it does not accomplish the goal. Anyone know of a method? For a testing framework, it seems like it should be obvious, but I've had a rough time digging through the UserGuide.

Example:

|check not equal| guid | c1acff01-e45b-4b7d-b6f5-84f8830ef6b4 | 

Scenario Pass: guid != c1acff01-e45b-4b7d-b6f5-84f8830ef6b4

¿Fue útil?

Solución

I was unable to find this type of test condition, so instead, I put the logic inside the Fixture code with the expectation to return true when a != b. In the Fit code, I had the following:

|check|guidsNotEqual|true|

Otros consejos

With fitSharp you can have

|check|mymethod|fail[myvalue]|

This will pass if mymethod is not equal to myvalue. I don't think this works with the Java FitLibrary.

There is an option (might be added after the question was asked). It is possible to check for something not equal by using 'check not'. So

|check not|this is true|false| 

will return true

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top