tests: tests for dart repositories
This commit is contained in:
@@ -9,8 +9,8 @@ class User with _$User {
|
||||
required String name,
|
||||
required String email,
|
||||
String? passwordHash,
|
||||
DateTime? createdAt,
|
||||
DateTime? updatedAt,
|
||||
required DateTime createdAt,
|
||||
required DateTime updatedAt,
|
||||
}) = _User;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ mixin _$User {
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get email => throw _privateConstructorUsedError;
|
||||
String? get passwordHash => throw _privateConstructorUsedError;
|
||||
DateTime? get createdAt => throw _privateConstructorUsedError;
|
||||
DateTime? get updatedAt => throw _privateConstructorUsedError;
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -39,8 +39,8 @@ abstract class $UserCopyWith<$Res> {
|
||||
String name,
|
||||
String email,
|
||||
String? passwordHash,
|
||||
DateTime? createdAt,
|
||||
DateTime? updatedAt});
|
||||
DateTime createdAt,
|
||||
DateTime updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -62,8 +62,8 @@ class _$UserCopyWithImpl<$Res, $Val extends User>
|
||||
Object? name = null,
|
||||
Object? email = null,
|
||||
Object? passwordHash = freezed,
|
||||
Object? createdAt = freezed,
|
||||
Object? updatedAt = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
@@ -82,14 +82,14 @@ class _$UserCopyWithImpl<$Res, $Val extends User>
|
||||
? _value.passwordHash
|
||||
: passwordHash // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
createdAt: freezed == createdAt
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
updatedAt: freezed == updatedAt
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
as DateTime,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -106,8 +106,8 @@ abstract class _$$UserImplCopyWith<$Res> implements $UserCopyWith<$Res> {
|
||||
String name,
|
||||
String email,
|
||||
String? passwordHash,
|
||||
DateTime? createdAt,
|
||||
DateTime? updatedAt});
|
||||
DateTime createdAt,
|
||||
DateTime updatedAt});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -126,8 +126,8 @@ class __$$UserImplCopyWithImpl<$Res>
|
||||
Object? name = null,
|
||||
Object? email = null,
|
||||
Object? passwordHash = freezed,
|
||||
Object? createdAt = freezed,
|
||||
Object? updatedAt = freezed,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
}) {
|
||||
return _then(_$UserImpl(
|
||||
id: null == id
|
||||
@@ -146,14 +146,14 @@ class __$$UserImplCopyWithImpl<$Res>
|
||||
? _value.passwordHash
|
||||
: passwordHash // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
createdAt: freezed == createdAt
|
||||
createdAt: null == createdAt
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
updatedAt: freezed == updatedAt
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
as DateTime,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -166,8 +166,8 @@ class _$UserImpl implements _User {
|
||||
required this.name,
|
||||
required this.email,
|
||||
this.passwordHash,
|
||||
this.createdAt,
|
||||
this.updatedAt});
|
||||
required this.createdAt,
|
||||
required this.updatedAt});
|
||||
|
||||
@override
|
||||
final String id;
|
||||
@@ -178,9 +178,9 @@ class _$UserImpl implements _User {
|
||||
@override
|
||||
final String? passwordHash;
|
||||
@override
|
||||
final DateTime? createdAt;
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
final DateTime? updatedAt;
|
||||
final DateTime updatedAt;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -222,8 +222,8 @@ abstract class _User implements User {
|
||||
required final String name,
|
||||
required final String email,
|
||||
final String? passwordHash,
|
||||
final DateTime? createdAt,
|
||||
final DateTime? updatedAt}) = _$UserImpl;
|
||||
required final DateTime createdAt,
|
||||
required final DateTime updatedAt}) = _$UserImpl;
|
||||
|
||||
@override
|
||||
String get id;
|
||||
@@ -234,9 +234,9 @@ abstract class _User implements User {
|
||||
@override
|
||||
String? get passwordHash;
|
||||
@override
|
||||
DateTime? get createdAt;
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
DateTime? get updatedAt;
|
||||
DateTime get updatedAt;
|
||||
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
@@ -9,6 +9,9 @@ abstract class ProjectRepository {
|
||||
/// Finds a project by its unique ID.
|
||||
TaskEither<IError, Project> findById(String id);
|
||||
|
||||
// Finds all projects by a user's unique ID.
|
||||
TaskEither<IError, List<Project>> findByUserId(String userId);
|
||||
|
||||
/// Updates an existing project.
|
||||
TaskEither<IError, Project> update(ProjectUpdate project);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user