How to test if a value is greater than in flutter test

381

This is what you are looking for :
expect(valueOne, greaterThanOrEqualTo(valueTwo))

I noticed that flutter community is not very helpful when it comes to writing tests. So if you need any matcher read the docs. The matcher library is used to match the expected value. We have different methods which you can combine with expect(value, matcherFunction) and the unit test should work.

Share:
381
Charith Hettiarachchi
Author by

Charith Hettiarachchi

I am a university student who is currently working as a software engineer.

Updated on January 01, 2023

Comments

  • Charith Hettiarachchi
    Charith Hettiarachchi over 1 year

    I want to check if one value is greater than another value with flutter testing. I know that we can use expect to check if one value is equal to another value.

    expect(valueOne, valueTwo);
    

    But how can I check if valueOne is greaterThan valueTwo.

    Thanks!