-
-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added default interface method tests (#1881)
- Loading branch information
1 parent
b32c305
commit 396c2bf
Showing
4 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...rTests/_snapshots/InterfaceTests.DefaultInterfaceMethod#IGeneratedInterface.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//HintName: IGeneratedInterface.g.cs | ||
#nullable disable | ||
#pragma warning disable | ||
namespace Refit.Implementation | ||
{ | ||
|
||
partial class Generated | ||
{ | ||
|
||
/// <inheritdoc /> | ||
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] | ||
[global::System.Diagnostics.DebuggerNonUserCode] | ||
[global::RefitInternalGenerated.PreserveAttribute] | ||
[global::System.Reflection.Obfuscation(Exclude=true)] | ||
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] | ||
partial class RefitGeneratorTestIGeneratedInterface | ||
: global::RefitGeneratorTest.IGeneratedInterface | ||
|
||
{ | ||
/// <inheritdoc /> | ||
public global::System.Net.Http.HttpClient Client { get; } | ||
readonly global::Refit.IRequestBuilder requestBuilder; | ||
|
||
/// <inheritdoc /> | ||
public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient client, global::Refit.IRequestBuilder requestBuilder) | ||
{ | ||
Client = client; | ||
this.requestBuilder = requestBuilder; | ||
} | ||
|
||
|
||
/// <inheritdoc /> | ||
public async global::System.Threading.Tasks.Task<string> Get() | ||
{ | ||
var ______arguments = global::System.Array.Empty<object>(); | ||
var ______func = requestBuilder.BuildRestResultFuncForMethod("Get", global::System.Array.Empty<global::System.Type>() ); | ||
|
||
return await ((global::System.Threading.Tasks.Task<string>)______func(this.Client, ______arguments)).ConfigureAwait(false); | ||
} | ||
|
||
/// <inheritdoc /> | ||
async global::System.Threading.Tasks.Task<string> global::RefitGeneratorTest.IGeneratedInterface.Get() | ||
{ | ||
var ______arguments = global::System.Array.Empty<object>(); | ||
var ______func = requestBuilder.BuildRestResultFuncForMethod("Get", global::System.Array.Empty<global::System.Type>() ); | ||
|
||
return await ((global::System.Threading.Tasks.Task<string>)______func(this.Client, ______arguments)).ConfigureAwait(false); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#pragma warning restore |
53 changes: 53 additions & 0 deletions
53
...ests/_snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IBaseInterface.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//HintName: IBaseInterface.g.cs | ||
#nullable disable | ||
#pragma warning disable | ||
namespace Refit.Implementation | ||
{ | ||
|
||
partial class Generated | ||
{ | ||
|
||
/// <inheritdoc /> | ||
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] | ||
[global::System.Diagnostics.DebuggerNonUserCode] | ||
[global::RefitInternalGenerated.PreserveAttribute] | ||
[global::System.Reflection.Obfuscation(Exclude=true)] | ||
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] | ||
partial class RefitGeneratorTestIBaseInterface | ||
: global::RefitGeneratorTest.IBaseInterface | ||
|
||
{ | ||
/// <inheritdoc /> | ||
public global::System.Net.Http.HttpClient Client { get; } | ||
readonly global::Refit.IRequestBuilder requestBuilder; | ||
|
||
/// <inheritdoc /> | ||
public RefitGeneratorTestIBaseInterface(global::System.Net.Http.HttpClient client, global::Refit.IRequestBuilder requestBuilder) | ||
{ | ||
Client = client; | ||
this.requestBuilder = requestBuilder; | ||
} | ||
|
||
|
||
/// <inheritdoc /> | ||
public async global::System.Threading.Tasks.Task<string> GetPosts() | ||
{ | ||
var ______arguments = global::System.Array.Empty<object>(); | ||
var ______func = requestBuilder.BuildRestResultFuncForMethod("GetPosts", global::System.Array.Empty<global::System.Type>() ); | ||
|
||
return await ((global::System.Threading.Tasks.Task<string>)______func(this.Client, ______arguments)).ConfigureAwait(false); | ||
} | ||
|
||
/// <inheritdoc /> | ||
async global::System.Threading.Tasks.Task<string> global::RefitGeneratorTest.IBaseInterface.GetPosts() | ||
{ | ||
var ______arguments = global::System.Array.Empty<object>(); | ||
var ______func = requestBuilder.BuildRestResultFuncForMethod("GetPosts", global::System.Array.Empty<global::System.Type>() ); | ||
|
||
return await ((global::System.Threading.Tasks.Task<string>)______func(this.Client, ______arguments)).ConfigureAwait(false); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#pragma warning restore |
62 changes: 62 additions & 0 deletions
62
..._snapshots/InterfaceTests.DerivedDefaultInterfaceMethod#IGeneratedInterface.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
//HintName: IGeneratedInterface.g.cs | ||
#nullable disable | ||
#pragma warning disable | ||
namespace Refit.Implementation | ||
{ | ||
|
||
partial class Generated | ||
{ | ||
|
||
/// <inheritdoc /> | ||
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] | ||
[global::System.Diagnostics.DebuggerNonUserCode] | ||
[global::RefitInternalGenerated.PreserveAttribute] | ||
[global::System.Reflection.Obfuscation(Exclude=true)] | ||
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] | ||
partial class RefitGeneratorTestIGeneratedInterface | ||
: global::RefitGeneratorTest.IGeneratedInterface | ||
|
||
{ | ||
/// <inheritdoc /> | ||
public global::System.Net.Http.HttpClient Client { get; } | ||
readonly global::Refit.IRequestBuilder requestBuilder; | ||
|
||
/// <inheritdoc /> | ||
public RefitGeneratorTestIGeneratedInterface(global::System.Net.Http.HttpClient client, global::Refit.IRequestBuilder requestBuilder) | ||
{ | ||
Client = client; | ||
this.requestBuilder = requestBuilder; | ||
} | ||
|
||
|
||
/// <inheritdoc /> | ||
public async global::System.Threading.Tasks.Task<string> Get() | ||
{ | ||
var ______arguments = global::System.Array.Empty<object>(); | ||
var ______func = requestBuilder.BuildRestResultFuncForMethod("Get", global::System.Array.Empty<global::System.Type>() ); | ||
|
||
return await ((global::System.Threading.Tasks.Task<string>)______func(this.Client, ______arguments)).ConfigureAwait(false); | ||
} | ||
|
||
/// <inheritdoc /> | ||
async global::System.Threading.Tasks.Task<string> global::RefitGeneratorTest.IGeneratedInterface.Get() | ||
{ | ||
var ______arguments = global::System.Array.Empty<object>(); | ||
var ______func = requestBuilder.BuildRestResultFuncForMethod("Get", global::System.Array.Empty<global::System.Type>() ); | ||
|
||
return await ((global::System.Threading.Tasks.Task<string>)______func(this.Client, ______arguments)).ConfigureAwait(false); | ||
} | ||
|
||
/// <inheritdoc /> | ||
async global::System.Threading.Tasks.Task<string> global::RefitGeneratorTest.IBaseInterface.GetPosts() | ||
{ | ||
var ______arguments = global::System.Array.Empty<object>(); | ||
var ______func = requestBuilder.BuildRestResultFuncForMethod("GetPosts", global::System.Array.Empty<global::System.Type>() ); | ||
|
||
return await ((global::System.Threading.Tasks.Task<string>)______func(this.Client, ______arguments)).ConfigureAwait(false); | ||
} | ||
} | ||
} | ||
} | ||
|
||
#pragma warning restore |