Skip to content

Commit

Permalink
test properties
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Oct 25, 2022
1 parent 33aa55c commit 4a4b0df
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions flutter/test/attachment/screenshot_attachment_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'package:flutter/scheduler.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sentry/sentry.dart';
import 'package:sentry_flutter/src/screenshot/screenshot_attachment.dart';

void main() {
TestWidgetsFlutterBinding.ensureInitialized();

group('$ScreenshotAttachment ctor', () {
late Fixture fixture;

setUp(() {
fixture = Fixture();
});

test('properties', () async {
final sut = fixture.getSut();

expect(sut.attachmentType, SentryAttachment.typeAttachmentDefault);
expect(sut.contentType, 'image/png');
expect(sut.filename, 'screenshot.png');
expect(sut.addToTransactions, true);
});
});
}

class Fixture {
final schedulerBinding = SchedulerBinding.instance;
final options = SentryOptions();

ScreenshotAttachment getSut() {
return ScreenshotAttachment(SchedulerBinding.instance, SentryOptions());
}
}

0 comments on commit 4a4b0df

Please sign in to comment.