Skip to content

Commit

Permalink
add zap receipts test
Browse files Browse the repository at this point in the history
  • Loading branch information
frnandu committed Dec 25, 2024
1 parent dffd568 commit 504feff
Show file tree
Hide file tree
Showing 5 changed files with 867 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,12 @@ class MockNip01Event extends _i1.Mock implements _i3.Nip01Event {
),
returnValueForMissingStub: null,
);

@override
String? getFirstTag(String? name) => (super.noSuchMethod(Invocation.method(
#getFirstTag,
[name],
)) as String?);
}

/// A class which mocks [Nip05].
Expand Down
303 changes: 183 additions & 120 deletions packages/ndk/test/usecases/lnurl/lnurl_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Mocks generated by Mockito 5.4.5 from annotations
// Mocks generated by Mockito 5.4.4 from annotations
// in ndk/test/usecases/lnurl/lnurl_test.dart.
// Do not manually edit this file.

Expand All @@ -19,21 +19,30 @@ import 'package:mockito/src/dummies.dart' as _i5;
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: must_be_immutable
// 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);
_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);
_FakeStreamedResponse_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

/// A class which mocks [Client].
Expand All @@ -45,30 +54,46 @@ class MockClient extends _i1.Mock implements _i2.Client {
}

@override
_i3.Future<_i2.Response> head(Uri? url, {Map<String, String>? headers}) =>
_i3.Future<_i2.Response> head(
Uri? url, {
Map<String, String>? 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>);
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<String, String>? headers}) =>
_i3.Future<_i2.Response> get(
Uri? url, {
Map<String, String>? 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>);
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(
Expand All @@ -78,23 +103,28 @@ class MockClient extends _i1.Mock implements _i2.Client {
_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>);
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(
Expand All @@ -104,23 +134,28 @@ class MockClient extends _i1.Mock implements _i2.Client {
_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>);
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(
Expand All @@ -130,23 +165,28 @@ class MockClient extends _i1.Mock implements _i2.Client {
_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>);
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(
Expand All @@ -156,64 +196,87 @@ class MockClient extends _i1.Mock implements _i2.Client {
_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>);
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<String> read(Uri? url, {Map<String, String>? headers}) =>
_i3.Future<String> read(
Uri? url, {
Map<String, String>? headers,
}) =>
(super.noSuchMethod(
Invocation.method(#read, [url], {#headers: headers}),
returnValue: _i3.Future<String>.value(
_i5.dummyValue<String>(
this,
Invocation.method(#read, [url], {#headers: headers}),
),
),
)
as _i3.Future<String>);
Invocation.method(
#read,
[url],
{#headers: headers},
),
returnValue: _i3.Future<String>.value(_i5.dummyValue<String>(
this,
Invocation.method(
#read,
[url],
{#headers: headers},
),
)),
) as _i3.Future<String>);

@override
_i3.Future<_i6.Uint8List> readBytes(
Uri? url, {
Map<String, String>? headers,
}) =>
(super.noSuchMethod(
Invocation.method(#readBytes, [url], {#headers: headers}),
returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
)
as _i3.Future<_i6.Uint8List>);
Invocation.method(
#readBytes,
[url],
{#headers: headers},
),
returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
) as _i3.Future<_i6.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>);
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,
);
Invocation.method(
#close,
[],
),
returnValueForMissingStub: null,
);
}
Loading

0 comments on commit 504feff

Please sign in to comment.