Skip to content

Commit

Permalink
Updated tbdex_quote_notifier_test.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitrajsinha committed Oct 23, 2024
1 parent 033f7ff commit ffd4ee5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/features/tbdex/tbdex_quote_notifier_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ void main() async {
.thenAnswer((_) async => TestData.getExchange());
});

group('TbdexQuoteNotifier Stress Tests', () {
test('High-frequency polling with exponential backoff', () async {
group('TbdexQuoteNotifier', () {
test('should handle high-frequency polling with exponential backoff',
() async {
when(() => mockTbdexQuoteNotifier.pollForQuote(any(), any()))
.thenAnswer((_) async => TestData.getQuote());

Expand All @@ -33,7 +34,7 @@ void main() async {
.called(1);
});

test('Maximum retry attempts', () async {
test('should handle maximum retry attempts', () async {
when(() => mockTbdexQuoteNotifier.pollForQuote(any(), any()))
.thenThrow(Exception('Network error'));

Expand All @@ -43,7 +44,7 @@ void main() async {
.called(1);
});

test('Handling network latency', () async {
test('should handle network latency', () async {
when(() => mockTbdexQuoteNotifier.startPolling(any(), any()))
.thenAnswer((_) async {
await Future.delayed(const Duration(seconds: 5));
Expand Down

0 comments on commit ffd4ee5

Please sign in to comment.