Clone this wiki locally
FSharpSpec Equality Assertions
FSharpSpec comes with lots of built in assertions in form of
These methods test for value equality of two objects - no big surprise there.
If one object is
null, no exceptions is thrown, but the test will fail if it was not expected to be
`it "1 + 1 is 2" (1 + 1) should.equal 2` `it "1 + 1 is not 3" (1 + 1) shouldn't.equal 2`
These methods work like their
should.equal counterparts, but test for reference equality of two objects.
should.be, shouldn't be
These methods have two functions
Test for boolean equality (the same as should.equal for booleans).
it "true is true" true should.be true
it "true is not false" true shouldn't.be false
Test if a given object has/has not an expected type
it "'r' is a char" 'r' should.be typeof<char>