From c34100603ee9fdd50558b05c624d2f1a089d26e3 Mon Sep 17 00:00:00 2001 From: Yogesh Choudhary Date: Thu, 30 Nov 2023 11:14:48 +0530 Subject: [PATCH] barrel file + configuration template --- lib/src/annotation.dart | 25 +++++++++++++++++++++++++ lib/src/configuration.dart | 26 ++++++++++++++++++++++++++ lib/welltested_annotation.dart | 19 ++----------------- 3 files changed, 53 insertions(+), 17 deletions(-) create mode 100644 lib/src/annotation.dart create mode 100644 lib/src/configuration.dart diff --git a/lib/src/annotation.dart b/lib/src/annotation.dart new file mode 100644 index 0000000..5796381 --- /dev/null +++ b/lib/src/annotation.dart @@ -0,0 +1,25 @@ +/* + * Created on November 29th 2023 + * + * Copyright (C) 2023 Welltested AI - All Rights Reserved + * The code in this file is Intellectutal Property of Welltested AI. + * and can't be edited, redistributed or used without a valid license of it's product (Welltested)[https://welltested.ai] + */ + +///Annotate classes with [Welltested] to generate unit tests for it's methods. +/// +///Param: [excludedMethods] accepts functions to be excluded from testing. +class Welltested { + final List excludedMethods; + + const Welltested({ + this.excludedMethods = const [], + }); +} + +class Testcases { + final List testcases; + const Testcases( + this.testcases, + ); +} diff --git a/lib/src/configuration.dart b/lib/src/configuration.dart new file mode 100644 index 0000000..e2806d5 --- /dev/null +++ b/lib/src/configuration.dart @@ -0,0 +1,26 @@ +/* + * Created on November 29th 2023 + * + * Copyright (C) 2023 Welltested AI - All Rights Reserved + * The code in this file is Intellectutal Property of Welltested AI. + * and can't be edited, redistributed or used without a valid license of it's product (Welltested)[https://welltested.ai] + */ + +/// Welltested configuration class used for costumising the way the tests can be +/// generated using welltested. Currently supported costumizations: +/// - `generateMockFiles`: enable or disable the mock file generation automatically +/// after the tests has been generated +/// - `prefferedMockingLibrary`: ability to provide preffered 3rd party mocking +/// library that can be used to generate mocks. Currently supported options: none, +/// [mocktail](https://pub.dev/packages/mocktail), [mockito](https://pub.dev/packages/mockito) +abstract class WelltestedConfigurationFactory { + + bool _defaultGeneratedMockFiles = false; + + /// Parameter defines if Welltested should generated the mock files for the mock + /// annotated class(if any). If set to `true`, welltested will generate mock files + /// else mock files won't be generated by welltested automatically and user can + /// generate them using `dart build runner` command. Default is `false`. + bool get generateMockFiles => _defaultGeneratedMockFiles; + +} diff --git a/lib/welltested_annotation.dart b/lib/welltested_annotation.dart index 16a1017..b5427e5 100644 --- a/lib/welltested_annotation.dart +++ b/lib/welltested_annotation.dart @@ -6,20 +6,5 @@ * and can't be edited, redistributed or used without a valid license of it's product (Welltested)[https://welltested.ai] */ -///Annotate classes with [Welltested] to generate unit tests for it's methods. -/// -///Param: [excludedMethods] accepts functions to be excluded from testing. -class Welltested { - final List excludedMethods; - - const Welltested({ - this.excludedMethods = const [], - }); -} - -class Testcases { - final List testcases; - const Testcases( - this.testcases, - ); -} +export 'src/annotation.dart'; +export 'src/configuration.dart';