diff --git a/hakim_hub_mobile/test/features/chatbot/data/datasources/chat_remote_datasource_test.dart b/hakim_hub_mobile/test/features/chatbot/data/datasources/chat_remote_datasource_test.dart new file mode 100644 index 0000000..68d5dc4 --- /dev/null +++ b/hakim_hub_mobile/test/features/chatbot/data/datasources/chat_remote_datasource_test.dart @@ -0,0 +1,94 @@ +import 'dart:convert'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:hakim_hub_mobile/core/error/exception.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/datasources/chat_remote_data_soure.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_request_model.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_response_model.dart'; +import 'package:hakim_hub_mobile/features/chatbot/domain/entities/chat_request_entity.dart'; +import 'package:http/http.dart' as http; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; + +import 'chat_remote_datasource_test.mocks.dart'; + +@GenerateMocks([http.Client]) +void main() { + late ChatRemoteDataSourceImpl dataSource; + late MockClient mockHttpClient; + + setUp(() { + mockHttpClient = MockClient(); + dataSource = ChatRemoteDataSourceImpl(client: mockHttpClient); + }); + + // Test data for ChatRequestEntity + final ChatRequest testChatRequest = ChatRequest( + address: "Arada", + isNew: true, + message: 'I have headache', + ); + + // Test data for ChatRequestModel + final ChatRequestModel testChatRequestModel = ChatRequestModel( + address: "Arada", + isNew: true, + message: 'I have headache', + ); + + // Test data for JSON response + final Map jsonResponseData = { + "value": { + // Add your sample data for ChatResponseModel here + }, + }; + + test( + 'getResponse should return ChatResponseModel when the request is successful', + () async { + // Arrange + when(mockHttpClient.post(any, + body: anyNamed('body'), headers: anyNamed('headers'))) + .thenAnswer( + (_) async => http.Response(json.encode(jsonResponseData), 200)); + + // Act + final result = await dataSource.getResponse(testChatRequest); + + // Assert + expect(result, isA()); + // Add more assertions to validate the response data, if needed + }); + + test( + 'getResponse should throw ServerException when the response status code is not 200', + () async { + // Arrange + when(mockHttpClient.post(any, + body: anyNamed('body'), headers: anyNamed('headers'))) + .thenAnswer((_) async => http.Response('Error', 404)); + + // Act + final call = + dataSource.getResponse; // Wrap the call in a function to pass to expect + + // Assert + expect(() => call(testChatRequest), throwsA(isA())); + }); + + test( + 'getResponse should throw ServerException when an exception occurs during the request', + () async { + // Arrange + when(mockHttpClient.post(any, + body: anyNamed('body'), headers: anyNamed('headers'))) + .thenThrow(Exception()); + + // Act + final call = + dataSource.getResponse; // Wrap the call in a function to pass to expect + + // Assert + expect(() => call(testChatRequest), throwsA(isA())); + }); +} diff --git a/hakim_hub_mobile/test/features/chatbot/data/datasources/chat_remote_datasource_test.mocks.dart b/hakim_hub_mobile/test/features/chatbot/data/datasources/chat_remote_datasource_test.mocks.dart new file mode 100644 index 0000000..4d61360 --- /dev/null +++ b/hakim_hub_mobile/test/features/chatbot/data/datasources/chat_remote_datasource_test.mocks.dart @@ -0,0 +1,263 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in hakim_hub_mobile/test/features/chatbot/data/datasources/chat_remote_datasource_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; +import 'dart:convert' as _i4; +import 'dart:typed_data' as _i5; + +import 'package:http/http.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response { + _FakeResponse_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeStreamedResponse_1 extends _i1.SmartFake + implements _i2.StreamedResponse { + _FakeStreamedResponse_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Client]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockClient extends _i1.Mock implements _i2.Client { + MockClient() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.Future<_i2.Response> head( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + )), + ) as _i3.Future<_i2.Response>); + @override + _i3.Future<_i2.Response> get( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + )), + ) as _i3.Future<_i2.Response>); + @override + _i3.Future<_i2.Response> post( + Uri? url, { + Map? headers, + Object? body, + _i4.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); + @override + _i3.Future<_i2.Response> put( + Uri? url, { + Map? headers, + Object? body, + _i4.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); + @override + _i3.Future<_i2.Response> patch( + Uri? url, { + Map? headers, + Object? body, + _i4.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); + @override + _i3.Future<_i2.Response> delete( + Uri? url, { + Map? headers, + Object? body, + _i4.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); + @override + _i3.Future read( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #read, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future.value(''), + ) as _i3.Future); + @override + _i3.Future<_i5.Uint8List> readBytes( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #readBytes, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i5.Uint8List>.value(_i5.Uint8List(0)), + ) as _i3.Future<_i5.Uint8List>); + @override + _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => + (super.noSuchMethod( + Invocation.method( + #send, + [request], + ), + returnValue: + _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1( + this, + Invocation.method( + #send, + [request], + ), + )), + ) as _i3.Future<_i2.StreamedResponse>); + @override + void close() => super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValueForMissingStub: null, + ); +} diff --git a/hakim_hub_mobile/test/features/chatbot/data/models/chat_doctors_model_test.dart b/hakim_hub_mobile/test/features/chatbot/data/models/chat_doctors_model_test.dart new file mode 100644 index 0000000..f415d8d --- /dev/null +++ b/hakim_hub_mobile/test/features/chatbot/data/models/chat_doctors_model_test.dart @@ -0,0 +1,64 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_doctor_model.dart'; + +void main() { + // Test data for JSON + final Map jsonData = { + 'fullName': 'John Doe', + 'photoUrl': 'https://hakimhub.com/photo.png', + 'id': '12345', + 'specialities': ["Neurologiest"], + }; + + test('fromJson should create a valid ChatDoctorModel object', () { + // Arrange + const String fullName = 'John Doe'; + const String photoUrl = 'https://hakimhub.com/photo.png'; + const String id = '12345'; + const String speciality = 'Neurologiest'; + + // Act + final result = ChatDoctorModel.fromJson(jsonData); + + // Assert + expect(result, isA()); + expect(result.fullName, fullName); + expect(result.photoUrl, photoUrl); + expect(result.id, id); + expect(result.speciality, speciality); + }); + + test('fromJson should create a ChatDoctorModel object with empty speciality when "specialities" is empty', () { + // Arrange + final Map jsonDataWithEmptySpecialities = { + 'fullName': 'John Doe', + 'photoUrl': 'https://hakimhub.com/photo.png', + 'id': '12345', + 'specialities': [], + }; + + // Act + final result = ChatDoctorModel.fromJson(jsonDataWithEmptySpecialities); + + // Assert + expect(result, isA()); + expect(result.speciality, ""); + }); + + test('fromJson should create a ChatDoctorModel object with empty speciality when "specialities" is null', () { + // Arrange + final Map jsonDataWithoutSpecialities = { + 'fullName': 'John Doe', + 'photoUrl': 'https://hakimhub.com/photo.png', + 'id': '12345', + 'specialities': null, + }; + + // Act + final result = ChatDoctorModel.fromJson(jsonDataWithoutSpecialities); + + // Assert + expect(result, isA()); + expect(result.speciality, ""); + }); +} diff --git a/hakim_hub_mobile/test/features/chatbot/data/models/chat_institute_model_test.dart b/hakim_hub_mobile/test/features/chatbot/data/models/chat_institute_model_test.dart new file mode 100644 index 0000000..7826021 --- /dev/null +++ b/hakim_hub_mobile/test/features/chatbot/data/models/chat_institute_model_test.dart @@ -0,0 +1,86 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_doctor_model.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_institute_model.dart'; + +void main() { + + final Map doctorData1 = { + 'fullName': 'Dr. John Doe', + 'photoUrl': 'https://hakimhub.com/doctor1.png', + 'id': 'doctor123', + 'specialities': ['Pediatrics'], + }; + + final Map doctorData2 = { + 'fullName': 'Dr. Jane Smith', + 'photoUrl': 'https://hakimhub.com/doctor2.png', + 'id': 'doctor456', + 'specialities': ['Cardiology'], + }; + + // Test data for JSON + final Map jsonData = { + 'institutionName': 'Tikur Anbesa', + 'id': '123456', + 'logoUrl': 'https://hakimhub.com/logo.png', + 'doctors': [doctorData1, doctorData2] + }; + + test('fromJson should create a valid ChatInsituteModel object', () { + // Arrange + final List expectedDoctors = [ + ChatDoctorModel.fromJson(doctorData1), + ChatDoctorModel.fromJson(doctorData2), + ]; + + // Act + final result = ChatInsituteModel.fromJson(jsonData); + + // Assert + expect(result, isA()); + expect(result.instituteName, 'Tikur Anbesa'); + expect(result.instituteId, '123456'); + expect(result.logoUrl, 'https://hakimhub.com/logo.png'); + expect(result.doctors, expectedDoctors); + }); + + test('fromJson should create a ChatInsituteModel object with empty doctors list when "doctors" is null', () { + // Arrange + final Map jsonDataWithoutDoctors = { + 'institutionName': 'Tikur Anbesa', + 'id': '123456', + 'logoUrl': 'https://hakimhub.com/logo.png', + 'doctors': null, + }; + + // Act + final result = ChatInsituteModel.fromJson(jsonDataWithoutDoctors); + + // Assert + expect(result, isA()); + expect(result.instituteName, 'Tikur Anbesa'); + expect(result.instituteId, '123456'); + expect(result.logoUrl, 'https://hakimhub.com/logo.png'); + expect(result.doctors, []); + }); + + test('fromJson should create a ChatInsituteModel object with empty doctors list when "doctors" is empty', () { + // Arrange + final Map jsonDataWithEmptyDoctors = { + 'institutionName': 'Tikur Anbesa', + 'id': '123456', + 'logoUrl': 'https://hakimhub.com/logo.png', + 'doctors': [], + }; + + // Act + final result = ChatInsituteModel.fromJson(jsonDataWithEmptyDoctors); + + // Assert + expect(result, isA()); + expect(result.instituteName, 'Tikur Anbesa'); + expect(result.instituteId, '123456'); + expect(result.logoUrl, 'https://hakimhub.com/logo.png'); + expect(result.doctors, []); + }); +} diff --git a/hakim_hub_mobile/test/features/chatbot/data/models/chat_request_model_test.dart b/hakim_hub_mobile/test/features/chatbot/data/models/chat_request_model_test.dart new file mode 100644 index 0000000..299d3d5 --- /dev/null +++ b/hakim_hub_mobile/test/features/chatbot/data/models/chat_request_model_test.dart @@ -0,0 +1,25 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_request_model.dart'; + +void main() { + test('toJson should convert ChatRequestModel to a valid JSON map', () { + // Arrange + const String address = 'arada'; + const bool isNew = true; + const String message = 'I have headache'; + final ChatRequestModel chatRequestModel = ChatRequestModel( + address: address, + isNew: isNew, + message: message, + ); + + // Act + final Map result = chatRequestModel.toJson(); + + // Assert + expect(result, isA>()); + expect(result['Address'], address); + expect(result['isNewChat'], isNew); + expect(result['message'], message); + }); +} diff --git a/hakim_hub_mobile/test/features/chatbot/data/models/chat_response_model_test.dart b/hakim_hub_mobile/test/features/chatbot/data/models/chat_response_model_test.dart new file mode 100644 index 0000000..581a99b --- /dev/null +++ b/hakim_hub_mobile/test/features/chatbot/data/models/chat_response_model_test.dart @@ -0,0 +1,95 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_doctor_model.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_institute_model.dart'; +import 'package:hakim_hub_mobile/features/chatbot/data/models/chat_response_model.dart'; + +void main() { + + final Map doctorData1 = { + 'fullName': 'Dr. John Doe', + 'photoUrl': 'https://hakimhub.com/doctor1.png', + 'id': 'doctor123', + 'speciality': 'Pediatrics' + }; + + final Map doctorData2 = { + 'fullName': 'Dr. Jane Smith', + 'photoUrl': 'https://hakimhub.com/doctor2.png', + 'id': 'doctor456', + 'speciality': 'Cardiology' + }; + + final Map instituteData1 = { + 'institutionName': 'Institute A', + 'id': 'institute123', + 'logoUrl': 'https://hakimhub.com/institute1.png', + 'doctors': [doctorData1] + }; + + final Map instituteData2 = { + 'institutionName': 'Institute B', + 'id': 'institute456', + 'logoUrl': 'https://hakimhub.com/institute2.png', + 'doctors': [doctorData2] + }; + + // Test data for JSON + final Map jsonData = { + 'reply': 'I'm sorry to hear that. Could you please tell me about any other symptoms you may have experienced?', + 'speciality': 'Neurologist', + 'institutions': [instituteData1, instituteData2], + }; + + test('fromJson should create a valid ChatResponseModel object', () { + // Arrange + const String reply = 'I'm sorry to hear that. Could you please tell me about any other symptoms you may have experienced?'; + const String speciality = 'Neurologist'; + + // Add sample data for ChatInsituteModel here + final List expectedInstitutes = [ + ChatInsituteModel.fromJson(instituteData1), + ChatInsituteModel.fromJson(instituteData2), + ]; + + // Act + final ChatResponseModel result = ChatResponseModel.fromJson(jsonData); + + // Assert + expect(result, isA()); + expect(result.reply, reply); + expect(result.speciality, speciality); + expect(result.institutes, expectedInstitutes); + }); + + test('fromJson should create a ChatResponseModel object with empty institutes list when "institutions" is null', () { + // Arrange + final Map jsonDataWithoutInstitutes = { + 'reply': 'I'm sorry to hear that. Could you please tell me about any other symptoms you may have experienced?', + 'speciality': 'Neurologist', + 'institutions': null, + }; + + // Act + final ChatResponseModel result = ChatResponseModel.fromJson(jsonDataWithoutInstitutes); + + // Assert + expect(result, isA()); + expect(result.institutes, []); + }); + + test('fromJson should create a ChatResponseModel object with empty institutes list when "institutions" is empty', () { + // Arrange + final Map jsonDataWithEmptyInstitutes = { + 'reply': 'I'm sorry to hear that. Could you please tell me about any other symptoms you may have experienced?', + 'speciality': 'Neurologist', + 'institutions': [], + }; + + // Act + final ChatResponseModel result = ChatResponseModel.fromJson(jsonDataWithEmptyInstitutes); + + // Assert + expect(result, isA()); + expect(result.institutes, []); + }); +} diff --git a/hakim_hub_mobile/test/features/chatbot/presentation/bloc/chatbot-bloc-test.dart b/hakim_hub_mobile/test/features/chatbot/presentation/bloc/chatbot-bloc-test.dart new file mode 100644 index 0000000..b2a9d31 --- /dev/null +++ b/hakim_hub_mobile/test/features/chatbot/presentation/bloc/chatbot-bloc-test.dart @@ -0,0 +1,86 @@ +import 'package:dartz/dartz.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:hakim_hub_mobile/core/error/failures.dart'; +import 'package:hakim_hub_mobile/features/chatbot/presentation/bloc/chat_bot_bloc.dart'; +import 'package:hakim_hub_mobile/features/chatbot/domain/entities/chat_request_entity.dart'; +import 'package:hakim_hub_mobile/features/chatbot/domain/entities/chat_response_entity.dart'; +import 'package:hakim_hub_mobile/features/chatbot/domain/usecases/get_chat_response.dart'; +import 'package:mockito/mockito.dart'; +import 'package:mockito/annotations.dart'; + +import 'chatbot-bloc-test.mocks.dart'; + +// Mock the GetChatResponse use case +@GenerateMocks([GetChatResponse]) +void main() { + group('ChatBotBloc', () { + late ChatBotBloc chatBotBloc; + late MockGetChatResponse mockGetChatResponse; + + setUp(() { + mockGetChatResponse = MockGetChatResponse(); + chatBotBloc = ChatBotBloc(getChatResponse: mockGetChatResponse); + }); + + test('initial state should be ChatBotInitialState', () { + expect(chatBotBloc.state, equals(ChatBotInitialState())); + }); + + test( + 'emits ChatBotLoadingState and ChatBotSuccessState on successful response', + () { + // Mock the response you expect from the use case + final mockResponse = ChatResponse( + reply: "Hello! How can I assist you?", + institutes: [], + speciality: ""); + + // Simulate the response of the use case + when(mockGetChatResponse(any)) + .thenAnswer((_) async => Right(mockResponse)); + + // Dispatch the event to the bloc + chatBotBloc.add(GetChatResponseEvent( + request: ChatRequest(message: "Hi", address: "", isNew: true))); + + // Expect the correct states to be emitted + expectLater( + chatBotBloc.stream, + emitsInOrder([ + ChatBotLoadingState(), + ChatBotSuccessState(chatResponse: mockResponse), + ]), + ); + }); + + test('emits ChatBotLoadingState and ChatBotFailureState on error', () { + // Mock the error response from the use case + final mockError = ServerFailure(); + + // Simulate the error response of the use case + when(mockGetChatResponse(any)).thenAnswer((_) async => Left(mockError)); + + // Dispatch the event to the bloc + chatBotBloc.add(GetChatResponseEvent( + request: ChatRequest(message: "Error", isNew: true, address: ""))); + + // Expect the correct states to be emitted + expectLater( + chatBotBloc.stream, + emitsInOrder([ + ChatBotLoadingState(), + ChatBotFailureState(error: mockError), + ]), + ); + }); + + test('emits ChatBotInitialState when SetIntialStateEvent is added', () { + chatBotBloc.add(SetIntialStateEvent()); + expectLater(chatBotBloc.stream, emitsInOrder([ChatBotInitialState()])); + }); + + tearDown(() { + chatBotBloc.close(); + }); + }); +} diff --git a/hakim_hub_mobile/test/features/chatbot/presentation/bloc/chatbot-bloc-test.mocks.dart b/hakim_hub_mobile/test/features/chatbot/presentation/bloc/chatbot-bloc-test.mocks.dart new file mode 100644 index 0000000..733a7a4 --- /dev/null +++ b/hakim_hub_mobile/test/features/chatbot/presentation/bloc/chatbot-bloc-test.mocks.dart @@ -0,0 +1,86 @@ +// Mocks generated by Mockito 5.4.2 from annotations +// in hakim_hub_mobile/test/features/chatbot/presentation/bloc/chatbot-bloc-test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; + +import 'package:dartz/dartz.dart' as _i3; +import 'package:hakim_hub_mobile/core/error/failures.dart' as _i6; +import 'package:hakim_hub_mobile/features/chatbot/domain/entities/chat_request_entity.dart' + as _i8; +import 'package:hakim_hub_mobile/features/chatbot/domain/entities/chat_response_entity.dart' + as _i7; +import 'package:hakim_hub_mobile/features/chatbot/domain/repositories/chat_repository.dart' + as _i2; +import 'package:hakim_hub_mobile/features/chatbot/domain/usecases/get_chat_response.dart' + as _i4; +import 'package:mockito/mockito.dart' as _i1; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeChatRepository_0 extends _i1.SmartFake + implements _i2.ChatRepository { + _FakeChatRepository_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeEither_1 extends _i1.SmartFake implements _i3.Either { + _FakeEither_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [GetChatResponse]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockGetChatResponse extends _i1.Mock implements _i4.GetChatResponse { + MockGetChatResponse() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.ChatRepository get repository => (super.noSuchMethod( + Invocation.getter(#repository), + returnValue: _FakeChatRepository_0( + this, + Invocation.getter(#repository), + ), + ) as _i2.ChatRepository); + @override + _i5.Future<_i3.Either<_i6.Failure, _i7.ChatResponse>> call( + _i8.ChatRequest? chatRequest) => + (super.noSuchMethod( + Invocation.method( + #call, + [chatRequest], + ), + returnValue: + _i5.Future<_i3.Either<_i6.Failure, _i7.ChatResponse>>.value( + _FakeEither_1<_i6.Failure, _i7.ChatResponse>( + this, + Invocation.method( + #call, + [chatRequest], + ), + )), + ) as _i5.Future<_i3.Either<_i6.Failure, _i7.ChatResponse>>); +}