Created
March 16, 2022 16:47
-
-
Save Bharathh-Raj/8807469255d36d972b1e443df179e3c1 to your computer and use it in GitHub Desktop.
Flutter Unit Testing - Grouping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
group("Area of the circle",(){ | |
test("Area of the circle with radius 1 should be 3.141592", () { | |
// Arrange | |
Area area = Area(); | |
// Act | |
double result = area.circle(1); | |
// Assert | |
expect(result, 3.141592); | |
}); | |
test("Area of the circle with radius 10 should be 3.141592", () { | |
// Arrange | |
Area area = Area(); | |
// Act | |
double result = area.circle(10); | |
// Assert | |
expect(result, 314.1592); | |
}); | |
}); | |
test("Area.pi should be 3.141592", () { | |
// Arrange | |
// Act | |
// Assert | |
expect(Area.pi, 3.141592); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment