Skip to content

Instantly share code, notes, and snippets.

@badrinathvm
Last active October 14, 2017 23:33
Show Gist options
  • Save badrinathvm/7c3f0ab3cc8b20d776c8bc1d1d4027d7 to your computer and use it in GitHub Desktop.
Save badrinathvm/7c3f0ab3cc8b20d776c8bc1d1d4027d7 to your computer and use it in GitHub Desktop.
Price Validations
it("Price validations"){
expect(watch.price).toNot(beNil())
expect(watch.price).to(beTruthy())
//evaluating boundary cases
expect(watch.price).toNot(beLessThan(0))
expect(watch.price).to(beCloseTo(11, within: 0.69))
expect(watch.price).to(beLessThanOrEqualTo(11.69))
expect(watch.price).to(beGreaterThan(Double.pi))
expect(watch.price).toNot(beGreaterThan(11.69))
expect(watch.price).toNot(beGreaterThan(Double.infinity))
expect(watch.price).toNot(be(Double.signalingNaN))
expect(watch.price).toNot(be(Double.nan))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment