문제

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

도움이 되었습니까?

해결책

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|

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top