diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 072b913d..a99af4aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -125,6 +125,9 @@ jobs: # Run all tests - run: dotnet test --no-restore --no-build -c Release + if: matrix.os == 'ubuntu-latest' + - run: dotnet test --no-restore --no-build -c Release --filter Category!=PublicApi + if: matrix.os != 'ubuntu-latest' pack: needs: diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index febceb0a..c39bbe8e 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -83,6 +83,6 @@ jobs: run: | dotnet sonarscanner begin /k:"$SONAR_PROJECT_KEY" /o:"$SONAR_ORG_KEY" /d:sonar.host.url=https://sonarcloud.io /d:sonar.token="$SONAR_TOKEN" /d:sonar.cs.opencover.reportsPaths="**/*opencover.xml" $SONAR_PR_ARGS - dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByFile="test/**/*.cs" + dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByFile="test/**/*.cs" /p:VerifyPublicApi=false dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN" diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt new file mode 100644 index 00000000..3589d07f --- /dev/null +++ b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt @@ -0,0 +1,65 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")] +namespace MockHttp.Json +{ + public interface IJsonAdapter + { + string Serialize(object? value); + } + public static class JsonRequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T content) { } + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, MockHttp.Json.IJsonAdapter? adapter) { } + } + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseJsonAdapter(this MockHttp.IMockConfiguration mockConfig, MockHttp.Json.IJsonAdapter jsonAdapter) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + } +} +namespace MockHttp.Json.Newtonsoft +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseNewtonsoftJson(this MockHttp.IMockConfiguration mockConfig, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } + public class NewtonsoftAdapter : MockHttp.Json.IJsonAdapter + { + public NewtonsoftAdapter(Newtonsoft.Json.JsonSerializerSettings? settings = null) { } + public string Serialize(object? value) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, Newtonsoft.Json.JsonSerializerSettings? serializerSettings) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } +} +namespace MockHttp.Json.SystemTextJson +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseSystemTextJson(this MockHttp.IMockConfiguration mockConfig, System.Text.Json.JsonSerializerOptions? options = null) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, System.Text.Json.JsonSerializerOptions? serializerOptions) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + } + public sealed class SystemTextJsonAdapter : MockHttp.Json.IJsonAdapter + { + public SystemTextJsonAdapter(System.Text.Json.JsonSerializerOptions? options = null) { } + public string Serialize(object? value) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt new file mode 100644 index 00000000..4eed33e2 --- /dev/null +++ b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt @@ -0,0 +1,65 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")] +namespace MockHttp.Json +{ + public interface IJsonAdapter + { + string Serialize(object? value); + } + public static class JsonRequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T content) { } + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, MockHttp.Json.IJsonAdapter? adapter) { } + } + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseJsonAdapter(this MockHttp.IMockConfiguration mockConfig, MockHttp.Json.IJsonAdapter jsonAdapter) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + } +} +namespace MockHttp.Json.Newtonsoft +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseNewtonsoftJson(this MockHttp.IMockConfiguration mockConfig, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } + public class NewtonsoftAdapter : MockHttp.Json.IJsonAdapter + { + public NewtonsoftAdapter(Newtonsoft.Json.JsonSerializerSettings? settings = null) { } + public string Serialize(object? value) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, Newtonsoft.Json.JsonSerializerSettings? serializerSettings) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } +} +namespace MockHttp.Json.SystemTextJson +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseSystemTextJson(this MockHttp.IMockConfiguration mockConfig, System.Text.Json.JsonSerializerOptions? options = null) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, System.Text.Json.JsonSerializerOptions? serializerOptions) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + } + public sealed class SystemTextJsonAdapter : MockHttp.Json.IJsonAdapter + { + public SystemTextJsonAdapter(System.Text.Json.JsonSerializerOptions? options = null) { } + public string Serialize(object? value) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt new file mode 100644 index 00000000..cc246c12 --- /dev/null +++ b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt @@ -0,0 +1,65 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")] +namespace MockHttp.Json +{ + public interface IJsonAdapter + { + string Serialize(object? value); + } + public static class JsonRequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T content) { } + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, MockHttp.Json.IJsonAdapter? adapter) { } + } + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseJsonAdapter(this MockHttp.IMockConfiguration mockConfig, MockHttp.Json.IJsonAdapter jsonAdapter) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + } +} +namespace MockHttp.Json.Newtonsoft +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseNewtonsoftJson(this MockHttp.IMockConfiguration mockConfig, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } + public class NewtonsoftAdapter : MockHttp.Json.IJsonAdapter + { + public NewtonsoftAdapter(Newtonsoft.Json.JsonSerializerSettings? settings = null) { } + public string Serialize(object? value) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, Newtonsoft.Json.JsonSerializerSettings? serializerSettings) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } +} +namespace MockHttp.Json.SystemTextJson +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseSystemTextJson(this MockHttp.IMockConfiguration mockConfig, System.Text.Json.JsonSerializerOptions? options = null) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, System.Text.Json.JsonSerializerOptions? serializerOptions) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + } + public sealed class SystemTextJsonAdapter : MockHttp.Json.IJsonAdapter + { + public SystemTextJsonAdapter(System.Text.Json.JsonSerializerOptions? options = null) { } + public string Serialize(object? value) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt new file mode 100644 index 00000000..763ebd3d --- /dev/null +++ b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt @@ -0,0 +1,65 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName=".NET Framework 4.7.2")] +namespace MockHttp.Json +{ + public interface IJsonAdapter + { + string Serialize(object? value); + } + public static class JsonRequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T content) { } + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, MockHttp.Json.IJsonAdapter? adapter) { } + } + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseJsonAdapter(this MockHttp.IMockConfiguration mockConfig, MockHttp.Json.IJsonAdapter jsonAdapter) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + } +} +namespace MockHttp.Json.Newtonsoft +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseNewtonsoftJson(this MockHttp.IMockConfiguration mockConfig, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } + public class NewtonsoftAdapter : MockHttp.Json.IJsonAdapter + { + public NewtonsoftAdapter(Newtonsoft.Json.JsonSerializerSettings? settings = null) { } + public string Serialize(object? value) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, Newtonsoft.Json.JsonSerializerSettings? serializerSettings) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } +} +namespace MockHttp.Json.SystemTextJson +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseSystemTextJson(this MockHttp.IMockConfiguration mockConfig, System.Text.Json.JsonSerializerOptions? options = null) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, System.Text.Json.JsonSerializerOptions? serializerOptions) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + } + public sealed class SystemTextJsonAdapter : MockHttp.Json.IJsonAdapter + { + public SystemTextJsonAdapter(System.Text.Json.JsonSerializerOptions? options = null) { } + public string Serialize(object? value) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt new file mode 100644 index 00000000..e865405e --- /dev/null +++ b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt @@ -0,0 +1,65 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName=".NET Framework 4.8")] +namespace MockHttp.Json +{ + public interface IJsonAdapter + { + string Serialize(object? value); + } + public static class JsonRequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T content) { } + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, MockHttp.Json.IJsonAdapter? adapter) { } + } + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseJsonAdapter(this MockHttp.IMockConfiguration mockConfig, MockHttp.Json.IJsonAdapter jsonAdapter) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + } +} +namespace MockHttp.Json.Newtonsoft +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseNewtonsoftJson(this MockHttp.IMockConfiguration mockConfig, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } + public class NewtonsoftAdapter : MockHttp.Json.IJsonAdapter + { + public NewtonsoftAdapter(Newtonsoft.Json.JsonSerializerSettings? settings = null) { } + public string Serialize(object? value) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, Newtonsoft.Json.JsonSerializerSettings? serializerSettings) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } +} +namespace MockHttp.Json.SystemTextJson +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseSystemTextJson(this MockHttp.IMockConfiguration mockConfig, System.Text.Json.JsonSerializerOptions? options = null) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, System.Text.Json.JsonSerializerOptions? serializerOptions) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + } + public sealed class SystemTextJsonAdapter : MockHttp.Json.IJsonAdapter + { + public SystemTextJsonAdapter(System.Text.Json.JsonSerializerOptions? options = null) { } + public string Serialize(object? value) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt new file mode 100644 index 00000000..0cf2ac41 --- /dev/null +++ b/test/MockHttp.Json.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt @@ -0,0 +1,65 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName=".NET Standard 2.1")] +namespace MockHttp.Json +{ + public interface IJsonAdapter + { + string Serialize(object? value); + } + public static class JsonRequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T content) { } + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, MockHttp.Json.IJsonAdapter? adapter) { } + } + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseJsonAdapter(this MockHttp.IMockConfiguration mockConfig, MockHttp.Json.IJsonAdapter jsonAdapter) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, MockHttp.Json.IJsonAdapter? adapter = null) { } + } +} +namespace MockHttp.Json.Newtonsoft +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseNewtonsoftJson(this MockHttp.IMockConfiguration mockConfig, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } + public class NewtonsoftAdapter : MockHttp.Json.IJsonAdapter + { + public NewtonsoftAdapter(Newtonsoft.Json.JsonSerializerSettings? settings = null) { } + public string Serialize(object? value) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, Newtonsoft.Json.JsonSerializerSettings? serializerSettings) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, Newtonsoft.Json.JsonSerializerSettings? serializerSettings = null) { } + } +} +namespace MockHttp.Json.SystemTextJson +{ + public static class MockConfigurationExtensions + { + public static MockHttp.IMockConfiguration UseSystemTextJson(this MockHttp.IMockConfiguration mockConfig, System.Text.Json.JsonSerializerOptions? options = null) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching JsonBody(this MockHttp.RequestMatching builder, T body, System.Text.Json.JsonSerializerOptions? serializerOptions) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, System.Func jsonContentFactory, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult JsonBody(this MockHttp.Language.Response.IWithContent builder, T jsonContent, System.Text.Encoding? encoding = null, System.Text.Json.JsonSerializerOptions? serializerOptions = null) { } + } + public sealed class SystemTextJsonAdapter : MockHttp.Json.IJsonAdapter + { + public SystemTextJsonAdapter(System.Text.Json.JsonSerializerOptions? options = null) { } + public string Serialize(object? value) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Json.Tests/PublicApiTests.cs b/test/MockHttp.Json.Tests/PublicApiTests.cs new file mode 100644 index 00000000..1dfc594b --- /dev/null +++ b/test/MockHttp.Json.Tests/PublicApiTests.cs @@ -0,0 +1,11 @@ +using MockHttp.Specs; + +namespace MockHttp.Json; + +public sealed class PublicApiTests : PublicApiSpec +{ + public PublicApiTests() + : base(typeof(IJsonAdapter)) + { + } +} diff --git a/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt b/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt new file mode 100644 index 00000000..940f517d --- /dev/null +++ b/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt @@ -0,0 +1,25 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Resources.NeutralResourcesLanguage("en")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")] +namespace MockHttp +{ + public sealed class MockHttpServer : System.IAsyncDisposable, System.IDisposable + { + [System.Obsolete("Use the overload accepting an System.Uri.")] + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, string hostUrl) { } + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, System.Uri hostUri) { } + [System.Obsolete("Use the overload accepting an System.Uri.")] + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory, string hostUrl) { } + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory, System.Uri hostUri) { } + public MockHttp.MockHttpHandler Handler { get; } + public System.Uri HostUri { get; } + [System.Obsolete("Use the HostUri instead.")] + public string HostUrl { get; } + public bool IsStarted { get; } + public System.Net.Http.HttpClient CreateClient() { } + public void Dispose() { } + public System.Threading.Tasks.ValueTask DisposeAsync() { } + public System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken = default) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt b/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt new file mode 100644 index 00000000..20731476 --- /dev/null +++ b/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt @@ -0,0 +1,25 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Resources.NeutralResourcesLanguage("en")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")] +namespace MockHttp +{ + public sealed class MockHttpServer : System.IAsyncDisposable, System.IDisposable + { + [System.Obsolete("Use the overload accepting an System.Uri.")] + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, string hostUrl) { } + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, System.Uri hostUri) { } + [System.Obsolete("Use the overload accepting an System.Uri.")] + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory, string hostUrl) { } + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory, System.Uri hostUri) { } + public MockHttp.MockHttpHandler Handler { get; } + public System.Uri HostUri { get; } + [System.Obsolete("Use the HostUri instead.")] + public string HostUrl { get; } + public bool IsStarted { get; } + public System.Net.Http.HttpClient CreateClient() { } + public void Dispose() { } + public System.Threading.Tasks.ValueTask DisposeAsync() { } + public System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken = default) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_Core_3.1.verified.txt b/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_Core_3.1.verified.txt new file mode 100644 index 00000000..41f0a258 --- /dev/null +++ b/test/MockHttp.Server.Tests/PublicApiTests.Api_has_not_changed.NET_Core_3.1.verified.txt @@ -0,0 +1,25 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Resources.NeutralResourcesLanguage("en")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v3.1", FrameworkDisplayName=".NET Core 3.1")] +namespace MockHttp +{ + public sealed class MockHttpServer : System.IAsyncDisposable, System.IDisposable + { + [System.Obsolete("Use the overload accepting an System.Uri.")] + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, string hostUrl) { } + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, System.Uri hostUri) { } + [System.Obsolete("Use the overload accepting an System.Uri.")] + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory, string hostUrl) { } + public MockHttpServer(MockHttp.MockHttpHandler mockHttpHandler, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory, System.Uri hostUri) { } + public MockHttp.MockHttpHandler Handler { get; } + public System.Uri HostUri { get; } + [System.Obsolete("Use the HostUri instead.")] + public string HostUrl { get; } + public bool IsStarted { get; } + public System.Net.Http.HttpClient CreateClient() { } + public void Dispose() { } + public System.Threading.Tasks.ValueTask DisposeAsync() { } + public System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken = default) { } + public System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken = default) { } + } +} \ No newline at end of file diff --git a/test/MockHttp.Server.Tests/PublicApiTests.cs b/test/MockHttp.Server.Tests/PublicApiTests.cs new file mode 100644 index 00000000..e53ad0eb --- /dev/null +++ b/test/MockHttp.Server.Tests/PublicApiTests.cs @@ -0,0 +1,11 @@ +using MockHttp.Specs; + +namespace MockHttp; + +public sealed class PublicApiTests : PublicApiSpec +{ + public PublicApiTests() + : base(typeof(MockHttpServer)) + { + } +} diff --git a/test/MockHttp.Testing/MockHttp.Testing.csproj b/test/MockHttp.Testing/MockHttp.Testing.csproj index e63981d9..a8de4630 100644 --- a/test/MockHttp.Testing/MockHttp.Testing.csproj +++ b/test/MockHttp.Testing/MockHttp.Testing.csproj @@ -6,6 +6,9 @@ false MockHttp + true + false + $(DefineConstants);VERIFY_PUBLIC_API @@ -13,6 +16,11 @@ + + + + + diff --git a/test/MockHttp.Testing/Specs/PublicApiSpec.cs b/test/MockHttp.Testing/Specs/PublicApiSpec.cs new file mode 100644 index 00000000..1034db38 --- /dev/null +++ b/test/MockHttp.Testing/Specs/PublicApiSpec.cs @@ -0,0 +1,64 @@ +#if VERIFY_PUBLIC_API +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.Versioning; +using PublicApiGenerator; + +namespace MockHttp.Specs; + +[UsesVerify] +public abstract class PublicApiSpec +{ + private readonly Type _assemblyMarkerType; + private readonly string? _sourceFile; + + private readonly ApiGeneratorOptions _options = new() + { + ExcludeAttributes = + [ + typeof(InternalsVisibleToAttribute).FullName! + ], + DenyNamespacePrefixes = [] + }; + + protected PublicApiSpec(Type assemblyMarkerType, [CallerFilePath] string? sourceFile = default) + { + _assemblyMarkerType = assemblyMarkerType; + _sourceFile = sourceFile; + } + + [Fact] + [Trait("Category", "PublicApi")] + public Task Api_has_not_changed() + { + bool runningOnMono = Type.GetType("Mono.Runtime") != null; + if (runningOnMono) + { + return Task.CompletedTask; + } + + Assembly sut = _assemblyMarkerType.Assembly; + var settings = new VerifySettings(); + + string targetFramework = sut.GetCustomAttribute()?.FrameworkDisplayName?.Replace(' ', '_') + ?? throw new InvalidOperationException("Framework display name is required."); + settings.UseMethodName(nameof(Api_has_not_changed) + targetFramework); + + // Act + string publicApi = sut.GeneratePublicApi(_options); + + // Assert + // ReSharper disable once ExplicitCallerInfoArgument + return Verify(publicApi, settings, _sourceFile!); + } +} +#else +// Stub for unsupported frameworks +public abstract class PublicApiSpec +{ + // ReSharper disable once UnusedParameter.Local + protected PublicApiSpec(Type assemblyMarkerType) + { + } +} +#endif diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt new file mode 100644 index 00000000..c91ac085 --- /dev/null +++ b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_6.0.verified.txt @@ -0,0 +1,504 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")] +namespace MockHttp +{ + public static class AuthenticationRequestMatchingExtensions + { + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder, string token) { } + } + public sealed class BitRate + { + public override string ToString() { } + public static MockHttp.BitRate FiveG() { } + public static MockHttp.BitRate FourG() { } + public static MockHttp.BitRate FromInt32(int bitRate) { } + public static MockHttp.BitRate OneGigabit() { } + public static MockHttp.BitRate OneHundredMegabit() { } + public static MockHttp.BitRate TenMegabit() { } + public static MockHttp.BitRate ThreeG() { } + public static int ToInt32(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate TwoG() { } + public static int op_Explicit(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate op_Explicit(int bitRate) { } + } + [System.Serializable] + public class HttpMockException : System.Exception + { + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + protected HttpMockException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + } + public interface IFluentInterface + { + bool Equals(object obj); + int GetHashCode(); + System.Type GetType(); + string ToString(); + } + public interface IInvokedHttpRequest + { + System.Collections.Generic.IReadOnlyCollection Matchers { get; } + System.Net.Http.HttpRequestMessage Request { get; } + } + public interface IInvokedHttpRequestCollection : MockHttp.Threading.IConcurrentReadOnlyCollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable + { + void Clear(); + } + public interface IMockConfiguration + { + System.Collections.Generic.IReadOnlyDictionary Items { get; } + MockHttp.IMockConfiguration Use(TService service); + } + public static class IRespondsExtensions + { + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + } + public interface IResponseBuilder : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse, MockHttp.Language.Response.IWithStatusCode { } + public sealed class IsSent + { + public override string ToString() { } + public static MockHttp.IsSent AtLeast(int callCount) { } + public static MockHttp.IsSent AtLeastOnce() { } + public static MockHttp.IsSent AtMost(int callCount) { } + public static MockHttp.IsSent AtMostOnce() { } + public static MockHttp.IsSent Exactly(int callCount) { } + public static MockHttp.IsSent Never() { } + public static MockHttp.IsSent Once() { } + } + public sealed class MockHttpHandler : System.Net.Http.HttpMessageHandler, MockHttp.IMockConfiguration + { + public static readonly System.Text.Encoding DefaultEncoding; + public MockHttpHandler() { } + public MockHttp.Language.IRespondsThrows Fallback { get; } + public MockHttp.IInvokedHttpRequestCollection InvokedRequests { get; } + public void Reset() { } + protected override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { } + public void Verify() { } + public void Verify(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public void Verify(System.Action matching, System.Func times, string? because = null) { } + public void VerifyAll() { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, System.Func times, string? because = null) { } + public void VerifyNoOtherRequests() { } + public MockHttp.Language.IConfiguredRequest When(System.Action matching) { } + } + public class NetworkLatency + { + public override string ToString() { } + public static MockHttp.NetworkLatency Around(int latencyInMs) { } + public static MockHttp.NetworkLatency Around(System.TimeSpan latency) { } + public static MockHttp.NetworkLatency Between(int minMs, int maxMs) { } + public static MockHttp.NetworkLatency Between(System.TimeSpan min, System.TimeSpan max) { } + public static MockHttp.NetworkLatency FiveG() { } + public static MockHttp.NetworkLatency FourG() { } + public static MockHttp.NetworkLatency ThreeG() { } + public static MockHttp.NetworkLatency TwoG() { } + } + public class RequestMatching : MockHttp.IFluentInterface + { + public MockHttp.RequestMatching Not { get; } + protected virtual MockHttp.RequestMatching RegisterMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + protected virtual void ValidateMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + public MockHttp.RequestMatching With(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching Any(this MockHttp.RequestMatching builder, System.Action anyBuilder) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, byte[] body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, System.IO.Stream body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, System.Net.Http.Headers.MediaTypeHeaderValue mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string contentType, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string urlEncodedFormData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string key, string value) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTime date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTimeOffset date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, params string[] values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, string value, bool allowWildcards) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, T value) + where T : struct { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, string headers) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, System.Net.Http.HttpMethod method) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, string httpMethod) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, byte[] partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, System.IO.Stream partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string queryString) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, params string[] values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, string? value) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, string requestUri) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, System.Uri requestUri) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, string version) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, System.Version version) { } + public static MockHttp.RequestMatching Where(this MockHttp.RequestMatching builder, System.Linq.Expressions.Expression> expression) { } + public static MockHttp.RequestMatching WithoutBody(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching WithoutQueryString(this MockHttp.RequestMatching builder) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func> streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.IO.Stream streamContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Net.Http.HttpContent httpContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, string textContent, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent, int offset, int count) { } + public static MockHttp.Language.Response.IWithResponse ClientTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(this MockHttp.Language.Response.IWithContentType builder, string mediaType, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair> header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, System.Collections.Generic.IEnumerable value) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, params T[] value) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, MockHttp.NetworkLatency latency) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, System.Func latency) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult ServerTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(this MockHttp.Language.Response.IWithStatusCode builder, int statusCode, string? reasonPhrase = null) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, MockHttp.BitRate bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, System.Func bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, int bitRate) { } + } + public static class ResponseBuilderLinqToXmlExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult XmlBody(this MockHttp.Language.Response.IWithContent builder, System.Xml.Linq.XContainer xmlContent, System.Xml.XmlWriterSettings? settings = null) { } + } +} +namespace MockHttp.Http +{ + public static class HeaderNames + { + public const string Accept = "Accept"; + public const string AcceptCharset = "Accept-Charset"; + public const string AcceptEncoding = "Accept-Encoding"; + public const string AcceptLanguage = "Accept-Language"; + public const string AcceptRanges = "Accept-Ranges"; + public const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials"; + public const string AccessControlAllowHeaders = "Access-Control-Allow-Headers"; + public const string AccessControlAllowMethods = "Access-Control-Allow-Methods"; + public const string AccessControlAllowOrigin = "Access-Control-Allow-Origin"; + public const string AccessControlExposeHeaders = "Access-Control-Expose-Headers"; + public const string AccessControlMaxAge = "Access-Control-Max-Age"; + public const string AccessControlRequestHeaders = "Access-Control-Request-Headers"; + public const string AccessControlRequestMethod = "Access-Control-Request-Method"; + public const string Age = "Age"; + public const string Allow = "Allow"; + public const string Authority = ":authority"; + public const string Authorization = "Authorization"; + public const string CacheControl = "Cache-Control"; + public const string Connection = "Connection"; + public const string ContentDisposition = "Content-Disposition"; + public const string ContentEncoding = "Content-Encoding"; + public const string ContentLanguage = "Content-Language"; + public const string ContentLength = "Content-Length"; + public const string ContentLocation = "Content-Location"; + public const string ContentMD5 = "Content-MD5"; + public const string ContentRange = "Content-Range"; + public const string ContentSecurityPolicy = "Content-Security-Policy"; + public const string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"; + public const string ContentType = "Content-Type"; + public const string Cookie = "Cookie"; + public const string CorrelationContext = "Correlation-Context"; + public const string DNT = "DNT"; + public const string Date = "Date"; + public const string ETag = "ETag"; + public const string Expect = "Expect"; + public const string Expires = "Expires"; + public const string From = "From"; + public const string Host = "Host"; + public const string IfMatch = "If-Match"; + public const string IfModifiedSince = "If-Modified-Since"; + public const string IfNoneMatch = "If-None-Match"; + public const string IfRange = "If-Range"; + public const string IfUnmodifiedSince = "If-Unmodified-Since"; + public const string KeepAlive = "Keep-Alive"; + public const string LastModified = "Last-Modified"; + public const string Location = "Location"; + public const string MaxForwards = "Max-Forwards"; + public const string Method = ":method"; + public const string Origin = "Origin"; + public const string Path = ":path"; + public const string Pragma = "Pragma"; + public const string ProxyAuthenticate = "Proxy-Authenticate"; + public const string ProxyAuthorization = "Proxy-Authorization"; + public const string Range = "Range"; + public const string Referer = "Referer"; + public const string RequestId = "Request-Id"; + public const string RetryAfter = "Retry-After"; + public const string Scheme = ":scheme"; + public const string SecWebSocketAccept = "Sec-WebSocket-Accept"; + public const string SecWebSocketKey = "Sec-WebSocket-Key"; + public const string SecWebSocketProtocol = "Sec-WebSocket-Protocol"; + public const string SecWebSocketVersion = "Sec-WebSocket-Version"; + public const string Server = "Server"; + public const string SetCookie = "Set-Cookie"; + public const string Status = ":status"; + public const string StrictTransportSecurity = "Strict-Transport-Security"; + public const string TE = "TE"; + public const string TraceParent = "traceparent"; + public const string TraceState = "tracestate"; + public const string Trailer = "Trailer"; + public const string TransferEncoding = "Transfer-Encoding"; + public const string Translate = "Translate"; + public const string Upgrade = "Upgrade"; + public const string UpgradeInsecureRequests = "Upgrade-Insecure-Requests"; + public const string UserAgent = "User-Agent"; + public const string Vary = "Vary"; + public const string Via = "Via"; + public const string WWWAuthenticate = "WWW-Authenticate"; + public const string Warning = "Warning"; + public const string WebSocketSubProtocols = "Sec-WebSocket-Protocol"; + public const string XFrameOptions = "X-Frame-Options"; + } + public static class MediaTypes + { + public const string FormUrlEncoded = "application/x-www-form-urlencoded"; + public const string Html = "text/html"; + public const string Json = "application/json"; + public const string JsonProblemDetails = "application/problem+json"; + public const string MultipartFormData = "multipart/form-data"; + public const string OctetStream = "application/octet-stream"; + public const string PlainText = "text/plain"; + public const string Xml = "application/xml"; + public const string XmlProblemDetails = "application/problem+xml"; + } +} +namespace MockHttp.IO +{ + public class RateLimitedStream : System.IO.Stream + { + public RateLimitedStream(System.IO.Stream actualStream, int bitRate, bool leaveOpen = false) { } + public override bool CanRead { get; } + public override bool CanSeek { get; } + public override bool CanWrite { get; } + public override long Length { get; } + public override long Position { get; set; } + protected override void Dispose(bool disposing) { } + public override void Flush() { } + public override int Read(byte[] buffer, int offset, int count) { } + public override long Seek(long offset, System.IO.SeekOrigin origin) { } + public override void SetLength(long value) { } + public override void Write(byte[] buffer, int offset, int count) { } + } +} +namespace MockHttp.Language.Flow +{ + public interface ICallbackResult : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult { } + public interface IResponseResult : MockHttp.IFluentInterface { } + public interface ISequenceResponseResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface ISequenceThrowsResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IThrowsResult : MockHttp.IFluentInterface { } +} +namespace MockHttp.Language.Flow.Response +{ + public interface IWithContentResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContentType, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithHeadersResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithStatusCodeResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } +} +namespace MockHttp.Language +{ + public interface ICallback : MockHttp.IFluentInterface + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult + { + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + } + public interface IConfiguredRequest : MockHttp.IFluentInterface, MockHttp.Language.Flow.ICallbackResult, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.Flow.ISequenceResponseResult, MockHttp.Language.Flow.ISequenceThrowsResult, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.ICallback, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IRespondsThrows : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows { } + public interface IResponds : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IResponseResult + { + TResult RespondUsing(MockHttp.Responses.IResponseStrategy responseStrategy); + } + public interface IThrows : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IThrowsResult + { + TResult Throws(System.Exception exception); + TResult Throws() + where TException : System.Exception, new (); + } + public interface IVerifies : MockHttp.IFluentInterface + { + void Verifiable(); + void Verifiable(string because); + } +} +namespace MockHttp.Language.Response +{ + public interface IWithContent : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithContentResult Body(System.Func> httpContentFactory); + } + public interface IWithContentType : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(System.Net.Http.Headers.MediaTypeHeaderValue mediaType); + } + public interface IWithHeaders : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult Headers(System.Collections.Generic.IEnumerable>> headers); + } + public interface IWithResponse : MockHttp.IFluentInterface + { + System.Collections.Generic.IList Behaviors { get; } + } + public interface IWithStatusCode : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(System.Net.HttpStatusCode statusCode, string? reasonPhrase = null); + } +} +namespace MockHttp.Matchers +{ + public class AnyMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public AnyMatcher(System.Collections.Generic.IReadOnlyCollection matchers) { } + public bool IsExclusive { get; } + public System.Collections.Generic.IReadOnlyCollection Matchers { get; } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ContentMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public ContentMatcher() { } + public ContentMatcher(byte[] content) { } + public ContentMatcher(string content, System.Text.Encoding? encoding) { } + protected System.Collections.Generic.IReadOnlyList ByteContent { get; } + public virtual bool IsExclusive { get; } + protected virtual bool IsMatch(byte[] requestContent) { } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ExpressionMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public ExpressionMatcher(System.Linq.Expressions.Expression> expression) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class FormDataMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public FormDataMatcher(System.Collections.Generic.IEnumerable>> formData) { } + public FormDataMatcher(string urlEncodedFormData) { } + public virtual bool IsExclusive { get; } + public virtual System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpHeadersMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable>> headers) { } + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable> headers) { } + public HttpHeadersMatcher(string name) { } + public HttpHeadersMatcher(string name, System.Collections.Generic.IEnumerable values) { } + public HttpHeadersMatcher(string name, string value, bool allowWildcards = false) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpMethodMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpMethodMatcher(System.Net.Http.HttpMethod method) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class HttpRequestMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + protected HttpRequestMatcher() { } + public virtual bool IsExclusive { get; } + public abstract bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext); + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public abstract override string ToString() { } + } + public interface IAsyncHttpRequestMatcher + { + bool IsExclusive { get; } + System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext); + } + public class MediaTypeHeaderMatcher : MockHttp.Matchers.ValueMatcher + { + public MediaTypeHeaderMatcher(System.Net.Http.Headers.MediaTypeHeaderValue headerValue) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class PartialContentMatcher : MockHttp.Matchers.ContentMatcher + { + public PartialContentMatcher(byte[] content) { } + public PartialContentMatcher(string content, System.Text.Encoding? encoding) { } + public override bool IsExclusive { get; } + protected override bool IsMatch(byte[] requestContent) { } + public override string ToString() { } + } + public class QueryStringMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public QueryStringMatcher(System.Collections.Generic.IEnumerable>> parameters) { } + public QueryStringMatcher(string queryString) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + [System.Obsolete("Replaced with UriMatcher. Will be removed in next major release.")] + public class RequestUriMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public RequestUriMatcher(System.Uri uri) { } + public RequestUriMatcher(string uriString, bool allowWildcards = true) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class ValueMatcher : MockHttp.Matchers.HttpRequestMatcher + { + protected ValueMatcher(T value) { } + protected T Value { get; } + } + public class VersionMatcher : MockHttp.Matchers.ValueMatcher + { + public VersionMatcher(System.Version version) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } +} +namespace MockHttp.Responses +{ + public interface IResponseBehavior + { + System.Threading.Tasks.Task HandleAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, MockHttp.Responses.ResponseHandlerDelegate next, System.Threading.CancellationToken cancellationToken); + } + public interface IResponseStrategy + { + System.Threading.Tasks.Task ProduceResponseAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Threading.CancellationToken cancellationToken); + } + public class MockHttpRequestContext + { + public MockHttpRequestContext(System.Net.Http.HttpRequestMessage request, System.Collections.Generic.IReadOnlyDictionary? services = null) { } + public System.Net.Http.HttpRequestMessage Request { get; } + public System.Collections.Generic.IReadOnlyDictionary Services { get; } + public bool TryGetService([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out TService? service) { } + } + public delegate System.Threading.Tasks.Task ResponseHandlerDelegate(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, System.Threading.CancellationToken cancellationToken); +} +namespace MockHttp.Threading +{ + public interface IConcurrentReadOnlyCollection : System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable { } +} \ No newline at end of file diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt new file mode 100644 index 00000000..cb1d4606 --- /dev/null +++ b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_8.0.verified.txt @@ -0,0 +1,505 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName=".NET 8.0")] +namespace MockHttp +{ + public static class AuthenticationRequestMatchingExtensions + { + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder, string token) { } + } + public sealed class BitRate + { + public override string ToString() { } + public static MockHttp.BitRate FiveG() { } + public static MockHttp.BitRate FourG() { } + public static MockHttp.BitRate FromInt32(int bitRate) { } + public static MockHttp.BitRate OneGigabit() { } + public static MockHttp.BitRate OneHundredMegabit() { } + public static MockHttp.BitRate TenMegabit() { } + public static MockHttp.BitRate ThreeG() { } + public static int ToInt32(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate TwoG() { } + public static int op_Explicit(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate op_Explicit(int bitRate) { } + } + [System.Serializable] + public class HttpMockException : System.Exception + { + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [System.Obsolete(DiagnosticId="SYSLIB0051")] + protected HttpMockException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + } + public interface IFluentInterface + { + bool Equals(object obj); + int GetHashCode(); + System.Type GetType(); + string ToString(); + } + public interface IInvokedHttpRequest + { + System.Collections.Generic.IReadOnlyCollection Matchers { get; } + System.Net.Http.HttpRequestMessage Request { get; } + } + public interface IInvokedHttpRequestCollection : MockHttp.Threading.IConcurrentReadOnlyCollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable + { + void Clear(); + } + public interface IMockConfiguration + { + System.Collections.Generic.IReadOnlyDictionary Items { get; } + MockHttp.IMockConfiguration Use(TService service); + } + public static class IRespondsExtensions + { + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + } + public interface IResponseBuilder : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse, MockHttp.Language.Response.IWithStatusCode { } + public sealed class IsSent + { + public override string ToString() { } + public static MockHttp.IsSent AtLeast(int callCount) { } + public static MockHttp.IsSent AtLeastOnce() { } + public static MockHttp.IsSent AtMost(int callCount) { } + public static MockHttp.IsSent AtMostOnce() { } + public static MockHttp.IsSent Exactly(int callCount) { } + public static MockHttp.IsSent Never() { } + public static MockHttp.IsSent Once() { } + } + public sealed class MockHttpHandler : System.Net.Http.HttpMessageHandler, MockHttp.IMockConfiguration + { + public static readonly System.Text.Encoding DefaultEncoding; + public MockHttpHandler() { } + public MockHttp.Language.IRespondsThrows Fallback { get; } + public MockHttp.IInvokedHttpRequestCollection InvokedRequests { get; } + public void Reset() { } + protected override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { } + public void Verify() { } + public void Verify(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public void Verify(System.Action matching, System.Func times, string? because = null) { } + public void VerifyAll() { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, System.Func times, string? because = null) { } + public void VerifyNoOtherRequests() { } + public MockHttp.Language.IConfiguredRequest When(System.Action matching) { } + } + public class NetworkLatency + { + public override string ToString() { } + public static MockHttp.NetworkLatency Around(int latencyInMs) { } + public static MockHttp.NetworkLatency Around(System.TimeSpan latency) { } + public static MockHttp.NetworkLatency Between(int minMs, int maxMs) { } + public static MockHttp.NetworkLatency Between(System.TimeSpan min, System.TimeSpan max) { } + public static MockHttp.NetworkLatency FiveG() { } + public static MockHttp.NetworkLatency FourG() { } + public static MockHttp.NetworkLatency ThreeG() { } + public static MockHttp.NetworkLatency TwoG() { } + } + public class RequestMatching : MockHttp.IFluentInterface + { + public MockHttp.RequestMatching Not { get; } + protected virtual MockHttp.RequestMatching RegisterMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + protected virtual void ValidateMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + public MockHttp.RequestMatching With(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching Any(this MockHttp.RequestMatching builder, System.Action anyBuilder) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, byte[] body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, System.IO.Stream body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, System.Net.Http.Headers.MediaTypeHeaderValue mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string contentType, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string urlEncodedFormData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string key, string value) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTime date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTimeOffset date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, params string[] values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, string value, bool allowWildcards) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, T value) + where T : struct { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, string headers) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, System.Net.Http.HttpMethod method) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, string httpMethod) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, byte[] partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, System.IO.Stream partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string queryString) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, params string[] values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, string? value) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, [System.Diagnostics.CodeAnalysis.StringSyntax("Uri")] string requestUri) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, System.Uri requestUri) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, string version) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, System.Version version) { } + public static MockHttp.RequestMatching Where(this MockHttp.RequestMatching builder, System.Linq.Expressions.Expression> expression) { } + public static MockHttp.RequestMatching WithoutBody(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching WithoutQueryString(this MockHttp.RequestMatching builder) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func> streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.IO.Stream streamContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Net.Http.HttpContent httpContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, string textContent, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent, int offset, int count) { } + public static MockHttp.Language.Response.IWithResponse ClientTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(this MockHttp.Language.Response.IWithContentType builder, string mediaType, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair> header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, System.Collections.Generic.IEnumerable value) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, params T[] value) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, MockHttp.NetworkLatency latency) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, System.Func latency) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult ServerTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(this MockHttp.Language.Response.IWithStatusCode builder, int statusCode, string? reasonPhrase = null) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, MockHttp.BitRate bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, System.Func bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, int bitRate) { } + } + public static class ResponseBuilderLinqToXmlExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult XmlBody(this MockHttp.Language.Response.IWithContent builder, System.Xml.Linq.XContainer xmlContent, System.Xml.XmlWriterSettings? settings = null) { } + } +} +namespace MockHttp.Http +{ + public static class HeaderNames + { + public const string Accept = "Accept"; + public const string AcceptCharset = "Accept-Charset"; + public const string AcceptEncoding = "Accept-Encoding"; + public const string AcceptLanguage = "Accept-Language"; + public const string AcceptRanges = "Accept-Ranges"; + public const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials"; + public const string AccessControlAllowHeaders = "Access-Control-Allow-Headers"; + public const string AccessControlAllowMethods = "Access-Control-Allow-Methods"; + public const string AccessControlAllowOrigin = "Access-Control-Allow-Origin"; + public const string AccessControlExposeHeaders = "Access-Control-Expose-Headers"; + public const string AccessControlMaxAge = "Access-Control-Max-Age"; + public const string AccessControlRequestHeaders = "Access-Control-Request-Headers"; + public const string AccessControlRequestMethod = "Access-Control-Request-Method"; + public const string Age = "Age"; + public const string Allow = "Allow"; + public const string Authority = ":authority"; + public const string Authorization = "Authorization"; + public const string CacheControl = "Cache-Control"; + public const string Connection = "Connection"; + public const string ContentDisposition = "Content-Disposition"; + public const string ContentEncoding = "Content-Encoding"; + public const string ContentLanguage = "Content-Language"; + public const string ContentLength = "Content-Length"; + public const string ContentLocation = "Content-Location"; + public const string ContentMD5 = "Content-MD5"; + public const string ContentRange = "Content-Range"; + public const string ContentSecurityPolicy = "Content-Security-Policy"; + public const string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"; + public const string ContentType = "Content-Type"; + public const string Cookie = "Cookie"; + public const string CorrelationContext = "Correlation-Context"; + public const string DNT = "DNT"; + public const string Date = "Date"; + public const string ETag = "ETag"; + public const string Expect = "Expect"; + public const string Expires = "Expires"; + public const string From = "From"; + public const string Host = "Host"; + public const string IfMatch = "If-Match"; + public const string IfModifiedSince = "If-Modified-Since"; + public const string IfNoneMatch = "If-None-Match"; + public const string IfRange = "If-Range"; + public const string IfUnmodifiedSince = "If-Unmodified-Since"; + public const string KeepAlive = "Keep-Alive"; + public const string LastModified = "Last-Modified"; + public const string Location = "Location"; + public const string MaxForwards = "Max-Forwards"; + public const string Method = ":method"; + public const string Origin = "Origin"; + public const string Path = ":path"; + public const string Pragma = "Pragma"; + public const string ProxyAuthenticate = "Proxy-Authenticate"; + public const string ProxyAuthorization = "Proxy-Authorization"; + public const string Range = "Range"; + public const string Referer = "Referer"; + public const string RequestId = "Request-Id"; + public const string RetryAfter = "Retry-After"; + public const string Scheme = ":scheme"; + public const string SecWebSocketAccept = "Sec-WebSocket-Accept"; + public const string SecWebSocketKey = "Sec-WebSocket-Key"; + public const string SecWebSocketProtocol = "Sec-WebSocket-Protocol"; + public const string SecWebSocketVersion = "Sec-WebSocket-Version"; + public const string Server = "Server"; + public const string SetCookie = "Set-Cookie"; + public const string Status = ":status"; + public const string StrictTransportSecurity = "Strict-Transport-Security"; + public const string TE = "TE"; + public const string TraceParent = "traceparent"; + public const string TraceState = "tracestate"; + public const string Trailer = "Trailer"; + public const string TransferEncoding = "Transfer-Encoding"; + public const string Translate = "Translate"; + public const string Upgrade = "Upgrade"; + public const string UpgradeInsecureRequests = "Upgrade-Insecure-Requests"; + public const string UserAgent = "User-Agent"; + public const string Vary = "Vary"; + public const string Via = "Via"; + public const string WWWAuthenticate = "WWW-Authenticate"; + public const string Warning = "Warning"; + public const string WebSocketSubProtocols = "Sec-WebSocket-Protocol"; + public const string XFrameOptions = "X-Frame-Options"; + } + public static class MediaTypes + { + public const string FormUrlEncoded = "application/x-www-form-urlencoded"; + public const string Html = "text/html"; + public const string Json = "application/json"; + public const string JsonProblemDetails = "application/problem+json"; + public const string MultipartFormData = "multipart/form-data"; + public const string OctetStream = "application/octet-stream"; + public const string PlainText = "text/plain"; + public const string Xml = "application/xml"; + public const string XmlProblemDetails = "application/problem+xml"; + } +} +namespace MockHttp.IO +{ + public class RateLimitedStream : System.IO.Stream + { + public RateLimitedStream(System.IO.Stream actualStream, int bitRate, bool leaveOpen = false) { } + public override bool CanRead { get; } + public override bool CanSeek { get; } + public override bool CanWrite { get; } + public override long Length { get; } + public override long Position { get; set; } + protected override void Dispose(bool disposing) { } + public override void Flush() { } + public override int Read(byte[] buffer, int offset, int count) { } + public override long Seek(long offset, System.IO.SeekOrigin origin) { } + public override void SetLength(long value) { } + public override void Write(byte[] buffer, int offset, int count) { } + } +} +namespace MockHttp.Language.Flow +{ + public interface ICallbackResult : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult { } + public interface IResponseResult : MockHttp.IFluentInterface { } + public interface ISequenceResponseResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface ISequenceThrowsResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IThrowsResult : MockHttp.IFluentInterface { } +} +namespace MockHttp.Language.Flow.Response +{ + public interface IWithContentResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContentType, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithHeadersResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithStatusCodeResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } +} +namespace MockHttp.Language +{ + public interface ICallback : MockHttp.IFluentInterface + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult + { + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + } + public interface IConfiguredRequest : MockHttp.IFluentInterface, MockHttp.Language.Flow.ICallbackResult, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.Flow.ISequenceResponseResult, MockHttp.Language.Flow.ISequenceThrowsResult, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.ICallback, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IRespondsThrows : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows { } + public interface IResponds : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IResponseResult + { + TResult RespondUsing(MockHttp.Responses.IResponseStrategy responseStrategy); + } + public interface IThrows : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IThrowsResult + { + TResult Throws(System.Exception exception); + TResult Throws() + where TException : System.Exception, new (); + } + public interface IVerifies : MockHttp.IFluentInterface + { + void Verifiable(); + void Verifiable(string because); + } +} +namespace MockHttp.Language.Response +{ + public interface IWithContent : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithContentResult Body(System.Func> httpContentFactory); + } + public interface IWithContentType : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(System.Net.Http.Headers.MediaTypeHeaderValue mediaType); + } + public interface IWithHeaders : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult Headers(System.Collections.Generic.IEnumerable>> headers); + } + public interface IWithResponse : MockHttp.IFluentInterface + { + System.Collections.Generic.IList Behaviors { get; } + } + public interface IWithStatusCode : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(System.Net.HttpStatusCode statusCode, string? reasonPhrase = null); + } +} +namespace MockHttp.Matchers +{ + public class AnyMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public AnyMatcher(System.Collections.Generic.IReadOnlyCollection matchers) { } + public bool IsExclusive { get; } + public System.Collections.Generic.IReadOnlyCollection Matchers { get; } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ContentMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public ContentMatcher() { } + public ContentMatcher(byte[] content) { } + public ContentMatcher(string content, System.Text.Encoding? encoding) { } + protected System.Collections.Generic.IReadOnlyList ByteContent { get; } + public virtual bool IsExclusive { get; } + protected virtual bool IsMatch(byte[] requestContent) { } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ExpressionMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public ExpressionMatcher(System.Linq.Expressions.Expression> expression) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class FormDataMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public FormDataMatcher(System.Collections.Generic.IEnumerable>> formData) { } + public FormDataMatcher(string urlEncodedFormData) { } + public virtual bool IsExclusive { get; } + public virtual System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpHeadersMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable>> headers) { } + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable> headers) { } + public HttpHeadersMatcher(string name) { } + public HttpHeadersMatcher(string name, System.Collections.Generic.IEnumerable values) { } + public HttpHeadersMatcher(string name, string value, bool allowWildcards = false) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpMethodMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpMethodMatcher(System.Net.Http.HttpMethod method) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class HttpRequestMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + protected HttpRequestMatcher() { } + public virtual bool IsExclusive { get; } + public abstract bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext); + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public abstract override string ToString() { } + } + public interface IAsyncHttpRequestMatcher + { + bool IsExclusive { get; } + System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext); + } + public class MediaTypeHeaderMatcher : MockHttp.Matchers.ValueMatcher + { + public MediaTypeHeaderMatcher(System.Net.Http.Headers.MediaTypeHeaderValue headerValue) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class PartialContentMatcher : MockHttp.Matchers.ContentMatcher + { + public PartialContentMatcher(byte[] content) { } + public PartialContentMatcher(string content, System.Text.Encoding? encoding) { } + public override bool IsExclusive { get; } + protected override bool IsMatch(byte[] requestContent) { } + public override string ToString() { } + } + public class QueryStringMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public QueryStringMatcher(System.Collections.Generic.IEnumerable>> parameters) { } + public QueryStringMatcher(string queryString) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + [System.Obsolete("Replaced with UriMatcher. Will be removed in next major release.")] + public class RequestUriMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public RequestUriMatcher(System.Uri uri) { } + public RequestUriMatcher(string uriString, bool allowWildcards = true) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class ValueMatcher : MockHttp.Matchers.HttpRequestMatcher + { + protected ValueMatcher(T value) { } + protected T Value { get; } + } + public class VersionMatcher : MockHttp.Matchers.ValueMatcher + { + public VersionMatcher(System.Version version) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } +} +namespace MockHttp.Responses +{ + public interface IResponseBehavior + { + System.Threading.Tasks.Task HandleAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, MockHttp.Responses.ResponseHandlerDelegate next, System.Threading.CancellationToken cancellationToken); + } + public interface IResponseStrategy + { + System.Threading.Tasks.Task ProduceResponseAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Threading.CancellationToken cancellationToken); + } + public class MockHttpRequestContext + { + public MockHttpRequestContext(System.Net.Http.HttpRequestMessage request, System.Collections.Generic.IReadOnlyDictionary? services = null) { } + public System.Net.Http.HttpRequestMessage Request { get; } + public System.Collections.Generic.IReadOnlyDictionary Services { get; } + public bool TryGetService([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out TService? service) { } + } + public delegate System.Threading.Tasks.Task ResponseHandlerDelegate(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, System.Threading.CancellationToken cancellationToken); +} +namespace MockHttp.Threading +{ + public interface IConcurrentReadOnlyCollection : System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable { } +} \ No newline at end of file diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt new file mode 100644 index 00000000..dadb1330 --- /dev/null +++ b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.6.2.verified.txt @@ -0,0 +1,504 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")] +namespace MockHttp +{ + public static class AuthenticationRequestMatchingExtensions + { + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder, string token) { } + } + public sealed class BitRate + { + public override string ToString() { } + public static MockHttp.BitRate FiveG() { } + public static MockHttp.BitRate FourG() { } + public static MockHttp.BitRate FromInt32(int bitRate) { } + public static MockHttp.BitRate OneGigabit() { } + public static MockHttp.BitRate OneHundredMegabit() { } + public static MockHttp.BitRate TenMegabit() { } + public static MockHttp.BitRate ThreeG() { } + public static int ToInt32(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate TwoG() { } + public static int op_Explicit(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate op_Explicit(int bitRate) { } + } + [System.Serializable] + public class HttpMockException : System.Exception + { + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + protected HttpMockException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + } + public interface IFluentInterface + { + bool Equals(object obj); + int GetHashCode(); + System.Type GetType(); + string ToString(); + } + public interface IInvokedHttpRequest + { + System.Collections.Generic.IReadOnlyCollection Matchers { get; } + System.Net.Http.HttpRequestMessage Request { get; } + } + public interface IInvokedHttpRequestCollection : MockHttp.Threading.IConcurrentReadOnlyCollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable + { + void Clear(); + } + public interface IMockConfiguration + { + System.Collections.Generic.IReadOnlyDictionary Items { get; } + MockHttp.IMockConfiguration Use(TService service); + } + public static class IRespondsExtensions + { + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + } + public interface IResponseBuilder : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse, MockHttp.Language.Response.IWithStatusCode { } + public sealed class IsSent + { + public override string ToString() { } + public static MockHttp.IsSent AtLeast(int callCount) { } + public static MockHttp.IsSent AtLeastOnce() { } + public static MockHttp.IsSent AtMost(int callCount) { } + public static MockHttp.IsSent AtMostOnce() { } + public static MockHttp.IsSent Exactly(int callCount) { } + public static MockHttp.IsSent Never() { } + public static MockHttp.IsSent Once() { } + } + public sealed class MockHttpHandler : System.Net.Http.HttpMessageHandler, MockHttp.IMockConfiguration + { + public static readonly System.Text.Encoding DefaultEncoding; + public MockHttpHandler() { } + public MockHttp.Language.IRespondsThrows Fallback { get; } + public MockHttp.IInvokedHttpRequestCollection InvokedRequests { get; } + public void Reset() { } + protected override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { } + public void Verify() { } + public void Verify(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public void Verify(System.Action matching, System.Func times, string? because = null) { } + public void VerifyAll() { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, System.Func times, string? because = null) { } + public void VerifyNoOtherRequests() { } + public MockHttp.Language.IConfiguredRequest When(System.Action matching) { } + } + public class NetworkLatency + { + public override string ToString() { } + public static MockHttp.NetworkLatency Around(int latencyInMs) { } + public static MockHttp.NetworkLatency Around(System.TimeSpan latency) { } + public static MockHttp.NetworkLatency Between(int minMs, int maxMs) { } + public static MockHttp.NetworkLatency Between(System.TimeSpan min, System.TimeSpan max) { } + public static MockHttp.NetworkLatency FiveG() { } + public static MockHttp.NetworkLatency FourG() { } + public static MockHttp.NetworkLatency ThreeG() { } + public static MockHttp.NetworkLatency TwoG() { } + } + public class RequestMatching : MockHttp.IFluentInterface + { + public MockHttp.RequestMatching Not { get; } + protected virtual MockHttp.RequestMatching RegisterMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + protected virtual void ValidateMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + public MockHttp.RequestMatching With(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching Any(this MockHttp.RequestMatching builder, System.Action anyBuilder) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, byte[] body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, System.IO.Stream body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, System.Net.Http.Headers.MediaTypeHeaderValue mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string contentType, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string urlEncodedFormData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string key, string value) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTime date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTimeOffset date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, params string[] values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, string value, bool allowWildcards) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, T value) + where T : struct { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, string headers) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, System.Net.Http.HttpMethod method) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, string httpMethod) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, byte[] partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, System.IO.Stream partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string queryString) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, params string[] values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, string? value) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, string requestUri) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, System.Uri requestUri) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, string version) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, System.Version version) { } + public static MockHttp.RequestMatching Where(this MockHttp.RequestMatching builder, System.Linq.Expressions.Expression> expression) { } + public static MockHttp.RequestMatching WithoutBody(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching WithoutQueryString(this MockHttp.RequestMatching builder) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func> streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.IO.Stream streamContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Net.Http.HttpContent httpContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, string textContent, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent, int offset, int count) { } + public static MockHttp.Language.Response.IWithResponse ClientTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(this MockHttp.Language.Response.IWithContentType builder, string mediaType, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair> header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, System.Collections.Generic.IEnumerable value) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, params T[] value) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, MockHttp.NetworkLatency latency) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, System.Func latency) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult ServerTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(this MockHttp.Language.Response.IWithStatusCode builder, int statusCode, string? reasonPhrase = null) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, MockHttp.BitRate bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, System.Func bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, int bitRate) { } + } + public static class ResponseBuilderLinqToXmlExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult XmlBody(this MockHttp.Language.Response.IWithContent builder, System.Xml.Linq.XContainer xmlContent, System.Xml.XmlWriterSettings? settings = null) { } + } +} +namespace MockHttp.Http +{ + public static class HeaderNames + { + public const string Accept = "Accept"; + public const string AcceptCharset = "Accept-Charset"; + public const string AcceptEncoding = "Accept-Encoding"; + public const string AcceptLanguage = "Accept-Language"; + public const string AcceptRanges = "Accept-Ranges"; + public const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials"; + public const string AccessControlAllowHeaders = "Access-Control-Allow-Headers"; + public const string AccessControlAllowMethods = "Access-Control-Allow-Methods"; + public const string AccessControlAllowOrigin = "Access-Control-Allow-Origin"; + public const string AccessControlExposeHeaders = "Access-Control-Expose-Headers"; + public const string AccessControlMaxAge = "Access-Control-Max-Age"; + public const string AccessControlRequestHeaders = "Access-Control-Request-Headers"; + public const string AccessControlRequestMethod = "Access-Control-Request-Method"; + public const string Age = "Age"; + public const string Allow = "Allow"; + public const string Authority = ":authority"; + public const string Authorization = "Authorization"; + public const string CacheControl = "Cache-Control"; + public const string Connection = "Connection"; + public const string ContentDisposition = "Content-Disposition"; + public const string ContentEncoding = "Content-Encoding"; + public const string ContentLanguage = "Content-Language"; + public const string ContentLength = "Content-Length"; + public const string ContentLocation = "Content-Location"; + public const string ContentMD5 = "Content-MD5"; + public const string ContentRange = "Content-Range"; + public const string ContentSecurityPolicy = "Content-Security-Policy"; + public const string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"; + public const string ContentType = "Content-Type"; + public const string Cookie = "Cookie"; + public const string CorrelationContext = "Correlation-Context"; + public const string DNT = "DNT"; + public const string Date = "Date"; + public const string ETag = "ETag"; + public const string Expect = "Expect"; + public const string Expires = "Expires"; + public const string From = "From"; + public const string Host = "Host"; + public const string IfMatch = "If-Match"; + public const string IfModifiedSince = "If-Modified-Since"; + public const string IfNoneMatch = "If-None-Match"; + public const string IfRange = "If-Range"; + public const string IfUnmodifiedSince = "If-Unmodified-Since"; + public const string KeepAlive = "Keep-Alive"; + public const string LastModified = "Last-Modified"; + public const string Location = "Location"; + public const string MaxForwards = "Max-Forwards"; + public const string Method = ":method"; + public const string Origin = "Origin"; + public const string Path = ":path"; + public const string Pragma = "Pragma"; + public const string ProxyAuthenticate = "Proxy-Authenticate"; + public const string ProxyAuthorization = "Proxy-Authorization"; + public const string Range = "Range"; + public const string Referer = "Referer"; + public const string RequestId = "Request-Id"; + public const string RetryAfter = "Retry-After"; + public const string Scheme = ":scheme"; + public const string SecWebSocketAccept = "Sec-WebSocket-Accept"; + public const string SecWebSocketKey = "Sec-WebSocket-Key"; + public const string SecWebSocketProtocol = "Sec-WebSocket-Protocol"; + public const string SecWebSocketVersion = "Sec-WebSocket-Version"; + public const string Server = "Server"; + public const string SetCookie = "Set-Cookie"; + public const string Status = ":status"; + public const string StrictTransportSecurity = "Strict-Transport-Security"; + public const string TE = "TE"; + public const string TraceParent = "traceparent"; + public const string TraceState = "tracestate"; + public const string Trailer = "Trailer"; + public const string TransferEncoding = "Transfer-Encoding"; + public const string Translate = "Translate"; + public const string Upgrade = "Upgrade"; + public const string UpgradeInsecureRequests = "Upgrade-Insecure-Requests"; + public const string UserAgent = "User-Agent"; + public const string Vary = "Vary"; + public const string Via = "Via"; + public const string WWWAuthenticate = "WWW-Authenticate"; + public const string Warning = "Warning"; + public const string WebSocketSubProtocols = "Sec-WebSocket-Protocol"; + public const string XFrameOptions = "X-Frame-Options"; + } + public static class MediaTypes + { + public const string FormUrlEncoded = "application/x-www-form-urlencoded"; + public const string Html = "text/html"; + public const string Json = "application/json"; + public const string JsonProblemDetails = "application/problem+json"; + public const string MultipartFormData = "multipart/form-data"; + public const string OctetStream = "application/octet-stream"; + public const string PlainText = "text/plain"; + public const string Xml = "application/xml"; + public const string XmlProblemDetails = "application/problem+xml"; + } +} +namespace MockHttp.IO +{ + public class RateLimitedStream : System.IO.Stream + { + public RateLimitedStream(System.IO.Stream actualStream, int bitRate, bool leaveOpen = false) { } + public override bool CanRead { get; } + public override bool CanSeek { get; } + public override bool CanWrite { get; } + public override long Length { get; } + public override long Position { get; set; } + protected override void Dispose(bool disposing) { } + public override void Flush() { } + public override int Read(byte[] buffer, int offset, int count) { } + public override long Seek(long offset, System.IO.SeekOrigin origin) { } + public override void SetLength(long value) { } + public override void Write(byte[] buffer, int offset, int count) { } + } +} +namespace MockHttp.Language.Flow +{ + public interface ICallbackResult : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult { } + public interface IResponseResult : MockHttp.IFluentInterface { } + public interface ISequenceResponseResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface ISequenceThrowsResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IThrowsResult : MockHttp.IFluentInterface { } +} +namespace MockHttp.Language.Flow.Response +{ + public interface IWithContentResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContentType, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithHeadersResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithStatusCodeResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } +} +namespace MockHttp.Language +{ + public interface ICallback : MockHttp.IFluentInterface + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult + { + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + } + public interface IConfiguredRequest : MockHttp.IFluentInterface, MockHttp.Language.Flow.ICallbackResult, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.Flow.ISequenceResponseResult, MockHttp.Language.Flow.ISequenceThrowsResult, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.ICallback, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IRespondsThrows : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows { } + public interface IResponds : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IResponseResult + { + TResult RespondUsing(MockHttp.Responses.IResponseStrategy responseStrategy); + } + public interface IThrows : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IThrowsResult + { + TResult Throws(System.Exception exception); + TResult Throws() + where TException : System.Exception, new (); + } + public interface IVerifies : MockHttp.IFluentInterface + { + void Verifiable(); + void Verifiable(string because); + } +} +namespace MockHttp.Language.Response +{ + public interface IWithContent : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithContentResult Body(System.Func> httpContentFactory); + } + public interface IWithContentType : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(System.Net.Http.Headers.MediaTypeHeaderValue mediaType); + } + public interface IWithHeaders : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult Headers(System.Collections.Generic.IEnumerable>> headers); + } + public interface IWithResponse : MockHttp.IFluentInterface + { + System.Collections.Generic.IList Behaviors { get; } + } + public interface IWithStatusCode : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(System.Net.HttpStatusCode statusCode, string? reasonPhrase = null); + } +} +namespace MockHttp.Matchers +{ + public class AnyMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public AnyMatcher(System.Collections.Generic.IReadOnlyCollection matchers) { } + public bool IsExclusive { get; } + public System.Collections.Generic.IReadOnlyCollection Matchers { get; } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ContentMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public ContentMatcher() { } + public ContentMatcher(byte[] content) { } + public ContentMatcher(string content, System.Text.Encoding? encoding) { } + protected System.Collections.Generic.IReadOnlyList ByteContent { get; } + public virtual bool IsExclusive { get; } + protected virtual bool IsMatch(byte[] requestContent) { } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ExpressionMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public ExpressionMatcher(System.Linq.Expressions.Expression> expression) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class FormDataMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public FormDataMatcher(System.Collections.Generic.IEnumerable>> formData) { } + public FormDataMatcher(string urlEncodedFormData) { } + public virtual bool IsExclusive { get; } + public virtual System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpHeadersMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable>> headers) { } + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable> headers) { } + public HttpHeadersMatcher(string name) { } + public HttpHeadersMatcher(string name, System.Collections.Generic.IEnumerable values) { } + public HttpHeadersMatcher(string name, string value, bool allowWildcards = false) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpMethodMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpMethodMatcher(System.Net.Http.HttpMethod method) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class HttpRequestMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + protected HttpRequestMatcher() { } + public virtual bool IsExclusive { get; } + public abstract bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext); + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public abstract override string ToString() { } + } + public interface IAsyncHttpRequestMatcher + { + bool IsExclusive { get; } + System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext); + } + public class MediaTypeHeaderMatcher : MockHttp.Matchers.ValueMatcher + { + public MediaTypeHeaderMatcher(System.Net.Http.Headers.MediaTypeHeaderValue headerValue) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class PartialContentMatcher : MockHttp.Matchers.ContentMatcher + { + public PartialContentMatcher(byte[] content) { } + public PartialContentMatcher(string content, System.Text.Encoding? encoding) { } + public override bool IsExclusive { get; } + protected override bool IsMatch(byte[] requestContent) { } + public override string ToString() { } + } + public class QueryStringMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public QueryStringMatcher(System.Collections.Generic.IEnumerable>> parameters) { } + public QueryStringMatcher(string queryString) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + [System.Obsolete("Replaced with UriMatcher. Will be removed in next major release.")] + public class RequestUriMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public RequestUriMatcher(System.Uri uri) { } + public RequestUriMatcher(string uriString, bool allowWildcards = true) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class ValueMatcher : MockHttp.Matchers.HttpRequestMatcher + { + protected ValueMatcher(T value) { } + protected T Value { get; } + } + public class VersionMatcher : MockHttp.Matchers.ValueMatcher + { + public VersionMatcher(System.Version version) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } +} +namespace MockHttp.Responses +{ + public interface IResponseBehavior + { + System.Threading.Tasks.Task HandleAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, MockHttp.Responses.ResponseHandlerDelegate next, System.Threading.CancellationToken cancellationToken); + } + public interface IResponseStrategy + { + System.Threading.Tasks.Task ProduceResponseAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Threading.CancellationToken cancellationToken); + } + public class MockHttpRequestContext + { + public MockHttpRequestContext(System.Net.Http.HttpRequestMessage request, System.Collections.Generic.IReadOnlyDictionary? services = null) { } + public System.Net.Http.HttpRequestMessage Request { get; } + public System.Collections.Generic.IReadOnlyDictionary Services { get; } + public bool TryGetService([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out TService? service) { } + } + public delegate System.Threading.Tasks.Task ResponseHandlerDelegate(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, System.Threading.CancellationToken cancellationToken); +} +namespace MockHttp.Threading +{ + public interface IConcurrentReadOnlyCollection : System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable { } +} \ No newline at end of file diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt new file mode 100644 index 00000000..b3b85f4b --- /dev/null +++ b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.7.2.verified.txt @@ -0,0 +1,504 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName=".NET Framework 4.7.2")] +namespace MockHttp +{ + public static class AuthenticationRequestMatchingExtensions + { + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder, string token) { } + } + public sealed class BitRate + { + public override string ToString() { } + public static MockHttp.BitRate FiveG() { } + public static MockHttp.BitRate FourG() { } + public static MockHttp.BitRate FromInt32(int bitRate) { } + public static MockHttp.BitRate OneGigabit() { } + public static MockHttp.BitRate OneHundredMegabit() { } + public static MockHttp.BitRate TenMegabit() { } + public static MockHttp.BitRate ThreeG() { } + public static int ToInt32(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate TwoG() { } + public static int op_Explicit(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate op_Explicit(int bitRate) { } + } + [System.Serializable] + public class HttpMockException : System.Exception + { + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + protected HttpMockException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + } + public interface IFluentInterface + { + bool Equals(object obj); + int GetHashCode(); + System.Type GetType(); + string ToString(); + } + public interface IInvokedHttpRequest + { + System.Collections.Generic.IReadOnlyCollection Matchers { get; } + System.Net.Http.HttpRequestMessage Request { get; } + } + public interface IInvokedHttpRequestCollection : MockHttp.Threading.IConcurrentReadOnlyCollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable + { + void Clear(); + } + public interface IMockConfiguration + { + System.Collections.Generic.IReadOnlyDictionary Items { get; } + MockHttp.IMockConfiguration Use(TService service); + } + public static class IRespondsExtensions + { + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + } + public interface IResponseBuilder : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse, MockHttp.Language.Response.IWithStatusCode { } + public sealed class IsSent + { + public override string ToString() { } + public static MockHttp.IsSent AtLeast(int callCount) { } + public static MockHttp.IsSent AtLeastOnce() { } + public static MockHttp.IsSent AtMost(int callCount) { } + public static MockHttp.IsSent AtMostOnce() { } + public static MockHttp.IsSent Exactly(int callCount) { } + public static MockHttp.IsSent Never() { } + public static MockHttp.IsSent Once() { } + } + public sealed class MockHttpHandler : System.Net.Http.HttpMessageHandler, MockHttp.IMockConfiguration + { + public static readonly System.Text.Encoding DefaultEncoding; + public MockHttpHandler() { } + public MockHttp.Language.IRespondsThrows Fallback { get; } + public MockHttp.IInvokedHttpRequestCollection InvokedRequests { get; } + public void Reset() { } + protected override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { } + public void Verify() { } + public void Verify(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public void Verify(System.Action matching, System.Func times, string? because = null) { } + public void VerifyAll() { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, System.Func times, string? because = null) { } + public void VerifyNoOtherRequests() { } + public MockHttp.Language.IConfiguredRequest When(System.Action matching) { } + } + public class NetworkLatency + { + public override string ToString() { } + public static MockHttp.NetworkLatency Around(int latencyInMs) { } + public static MockHttp.NetworkLatency Around(System.TimeSpan latency) { } + public static MockHttp.NetworkLatency Between(int minMs, int maxMs) { } + public static MockHttp.NetworkLatency Between(System.TimeSpan min, System.TimeSpan max) { } + public static MockHttp.NetworkLatency FiveG() { } + public static MockHttp.NetworkLatency FourG() { } + public static MockHttp.NetworkLatency ThreeG() { } + public static MockHttp.NetworkLatency TwoG() { } + } + public class RequestMatching : MockHttp.IFluentInterface + { + public MockHttp.RequestMatching Not { get; } + protected virtual MockHttp.RequestMatching RegisterMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + protected virtual void ValidateMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + public MockHttp.RequestMatching With(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching Any(this MockHttp.RequestMatching builder, System.Action anyBuilder) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, byte[] body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, System.IO.Stream body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, System.Net.Http.Headers.MediaTypeHeaderValue mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string contentType, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string urlEncodedFormData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string key, string value) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTime date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTimeOffset date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, params string[] values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, string value, bool allowWildcards) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, T value) + where T : struct { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, string headers) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, System.Net.Http.HttpMethod method) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, string httpMethod) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, byte[] partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, System.IO.Stream partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string queryString) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, params string[] values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, string? value) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, string requestUri) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, System.Uri requestUri) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, string version) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, System.Version version) { } + public static MockHttp.RequestMatching Where(this MockHttp.RequestMatching builder, System.Linq.Expressions.Expression> expression) { } + public static MockHttp.RequestMatching WithoutBody(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching WithoutQueryString(this MockHttp.RequestMatching builder) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func> streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.IO.Stream streamContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Net.Http.HttpContent httpContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, string textContent, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent, int offset, int count) { } + public static MockHttp.Language.Response.IWithResponse ClientTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(this MockHttp.Language.Response.IWithContentType builder, string mediaType, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair> header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, System.Collections.Generic.IEnumerable value) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, params T[] value) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, MockHttp.NetworkLatency latency) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, System.Func latency) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult ServerTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(this MockHttp.Language.Response.IWithStatusCode builder, int statusCode, string? reasonPhrase = null) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, MockHttp.BitRate bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, System.Func bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, int bitRate) { } + } + public static class ResponseBuilderLinqToXmlExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult XmlBody(this MockHttp.Language.Response.IWithContent builder, System.Xml.Linq.XContainer xmlContent, System.Xml.XmlWriterSettings? settings = null) { } + } +} +namespace MockHttp.Http +{ + public static class HeaderNames + { + public const string Accept = "Accept"; + public const string AcceptCharset = "Accept-Charset"; + public const string AcceptEncoding = "Accept-Encoding"; + public const string AcceptLanguage = "Accept-Language"; + public const string AcceptRanges = "Accept-Ranges"; + public const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials"; + public const string AccessControlAllowHeaders = "Access-Control-Allow-Headers"; + public const string AccessControlAllowMethods = "Access-Control-Allow-Methods"; + public const string AccessControlAllowOrigin = "Access-Control-Allow-Origin"; + public const string AccessControlExposeHeaders = "Access-Control-Expose-Headers"; + public const string AccessControlMaxAge = "Access-Control-Max-Age"; + public const string AccessControlRequestHeaders = "Access-Control-Request-Headers"; + public const string AccessControlRequestMethod = "Access-Control-Request-Method"; + public const string Age = "Age"; + public const string Allow = "Allow"; + public const string Authority = ":authority"; + public const string Authorization = "Authorization"; + public const string CacheControl = "Cache-Control"; + public const string Connection = "Connection"; + public const string ContentDisposition = "Content-Disposition"; + public const string ContentEncoding = "Content-Encoding"; + public const string ContentLanguage = "Content-Language"; + public const string ContentLength = "Content-Length"; + public const string ContentLocation = "Content-Location"; + public const string ContentMD5 = "Content-MD5"; + public const string ContentRange = "Content-Range"; + public const string ContentSecurityPolicy = "Content-Security-Policy"; + public const string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"; + public const string ContentType = "Content-Type"; + public const string Cookie = "Cookie"; + public const string CorrelationContext = "Correlation-Context"; + public const string DNT = "DNT"; + public const string Date = "Date"; + public const string ETag = "ETag"; + public const string Expect = "Expect"; + public const string Expires = "Expires"; + public const string From = "From"; + public const string Host = "Host"; + public const string IfMatch = "If-Match"; + public const string IfModifiedSince = "If-Modified-Since"; + public const string IfNoneMatch = "If-None-Match"; + public const string IfRange = "If-Range"; + public const string IfUnmodifiedSince = "If-Unmodified-Since"; + public const string KeepAlive = "Keep-Alive"; + public const string LastModified = "Last-Modified"; + public const string Location = "Location"; + public const string MaxForwards = "Max-Forwards"; + public const string Method = ":method"; + public const string Origin = "Origin"; + public const string Path = ":path"; + public const string Pragma = "Pragma"; + public const string ProxyAuthenticate = "Proxy-Authenticate"; + public const string ProxyAuthorization = "Proxy-Authorization"; + public const string Range = "Range"; + public const string Referer = "Referer"; + public const string RequestId = "Request-Id"; + public const string RetryAfter = "Retry-After"; + public const string Scheme = ":scheme"; + public const string SecWebSocketAccept = "Sec-WebSocket-Accept"; + public const string SecWebSocketKey = "Sec-WebSocket-Key"; + public const string SecWebSocketProtocol = "Sec-WebSocket-Protocol"; + public const string SecWebSocketVersion = "Sec-WebSocket-Version"; + public const string Server = "Server"; + public const string SetCookie = "Set-Cookie"; + public const string Status = ":status"; + public const string StrictTransportSecurity = "Strict-Transport-Security"; + public const string TE = "TE"; + public const string TraceParent = "traceparent"; + public const string TraceState = "tracestate"; + public const string Trailer = "Trailer"; + public const string TransferEncoding = "Transfer-Encoding"; + public const string Translate = "Translate"; + public const string Upgrade = "Upgrade"; + public const string UpgradeInsecureRequests = "Upgrade-Insecure-Requests"; + public const string UserAgent = "User-Agent"; + public const string Vary = "Vary"; + public const string Via = "Via"; + public const string WWWAuthenticate = "WWW-Authenticate"; + public const string Warning = "Warning"; + public const string WebSocketSubProtocols = "Sec-WebSocket-Protocol"; + public const string XFrameOptions = "X-Frame-Options"; + } + public static class MediaTypes + { + public const string FormUrlEncoded = "application/x-www-form-urlencoded"; + public const string Html = "text/html"; + public const string Json = "application/json"; + public const string JsonProblemDetails = "application/problem+json"; + public const string MultipartFormData = "multipart/form-data"; + public const string OctetStream = "application/octet-stream"; + public const string PlainText = "text/plain"; + public const string Xml = "application/xml"; + public const string XmlProblemDetails = "application/problem+xml"; + } +} +namespace MockHttp.IO +{ + public class RateLimitedStream : System.IO.Stream + { + public RateLimitedStream(System.IO.Stream actualStream, int bitRate, bool leaveOpen = false) { } + public override bool CanRead { get; } + public override bool CanSeek { get; } + public override bool CanWrite { get; } + public override long Length { get; } + public override long Position { get; set; } + protected override void Dispose(bool disposing) { } + public override void Flush() { } + public override int Read(byte[] buffer, int offset, int count) { } + public override long Seek(long offset, System.IO.SeekOrigin origin) { } + public override void SetLength(long value) { } + public override void Write(byte[] buffer, int offset, int count) { } + } +} +namespace MockHttp.Language.Flow +{ + public interface ICallbackResult : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult { } + public interface IResponseResult : MockHttp.IFluentInterface { } + public interface ISequenceResponseResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface ISequenceThrowsResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IThrowsResult : MockHttp.IFluentInterface { } +} +namespace MockHttp.Language.Flow.Response +{ + public interface IWithContentResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContentType, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithHeadersResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithStatusCodeResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } +} +namespace MockHttp.Language +{ + public interface ICallback : MockHttp.IFluentInterface + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult + { + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + } + public interface IConfiguredRequest : MockHttp.IFluentInterface, MockHttp.Language.Flow.ICallbackResult, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.Flow.ISequenceResponseResult, MockHttp.Language.Flow.ISequenceThrowsResult, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.ICallback, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IRespondsThrows : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows { } + public interface IResponds : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IResponseResult + { + TResult RespondUsing(MockHttp.Responses.IResponseStrategy responseStrategy); + } + public interface IThrows : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IThrowsResult + { + TResult Throws(System.Exception exception); + TResult Throws() + where TException : System.Exception, new (); + } + public interface IVerifies : MockHttp.IFluentInterface + { + void Verifiable(); + void Verifiable(string because); + } +} +namespace MockHttp.Language.Response +{ + public interface IWithContent : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithContentResult Body(System.Func> httpContentFactory); + } + public interface IWithContentType : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(System.Net.Http.Headers.MediaTypeHeaderValue mediaType); + } + public interface IWithHeaders : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult Headers(System.Collections.Generic.IEnumerable>> headers); + } + public interface IWithResponse : MockHttp.IFluentInterface + { + System.Collections.Generic.IList Behaviors { get; } + } + public interface IWithStatusCode : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(System.Net.HttpStatusCode statusCode, string? reasonPhrase = null); + } +} +namespace MockHttp.Matchers +{ + public class AnyMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public AnyMatcher(System.Collections.Generic.IReadOnlyCollection matchers) { } + public bool IsExclusive { get; } + public System.Collections.Generic.IReadOnlyCollection Matchers { get; } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ContentMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public ContentMatcher() { } + public ContentMatcher(byte[] content) { } + public ContentMatcher(string content, System.Text.Encoding? encoding) { } + protected System.Collections.Generic.IReadOnlyList ByteContent { get; } + public virtual bool IsExclusive { get; } + protected virtual bool IsMatch(byte[] requestContent) { } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ExpressionMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public ExpressionMatcher(System.Linq.Expressions.Expression> expression) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class FormDataMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public FormDataMatcher(System.Collections.Generic.IEnumerable>> formData) { } + public FormDataMatcher(string urlEncodedFormData) { } + public virtual bool IsExclusive { get; } + public virtual System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpHeadersMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable>> headers) { } + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable> headers) { } + public HttpHeadersMatcher(string name) { } + public HttpHeadersMatcher(string name, System.Collections.Generic.IEnumerable values) { } + public HttpHeadersMatcher(string name, string value, bool allowWildcards = false) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpMethodMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpMethodMatcher(System.Net.Http.HttpMethod method) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class HttpRequestMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + protected HttpRequestMatcher() { } + public virtual bool IsExclusive { get; } + public abstract bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext); + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public abstract override string ToString() { } + } + public interface IAsyncHttpRequestMatcher + { + bool IsExclusive { get; } + System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext); + } + public class MediaTypeHeaderMatcher : MockHttp.Matchers.ValueMatcher + { + public MediaTypeHeaderMatcher(System.Net.Http.Headers.MediaTypeHeaderValue headerValue) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class PartialContentMatcher : MockHttp.Matchers.ContentMatcher + { + public PartialContentMatcher(byte[] content) { } + public PartialContentMatcher(string content, System.Text.Encoding? encoding) { } + public override bool IsExclusive { get; } + protected override bool IsMatch(byte[] requestContent) { } + public override string ToString() { } + } + public class QueryStringMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public QueryStringMatcher(System.Collections.Generic.IEnumerable>> parameters) { } + public QueryStringMatcher(string queryString) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + [System.Obsolete("Replaced with UriMatcher. Will be removed in next major release.")] + public class RequestUriMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public RequestUriMatcher(System.Uri uri) { } + public RequestUriMatcher(string uriString, bool allowWildcards = true) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class ValueMatcher : MockHttp.Matchers.HttpRequestMatcher + { + protected ValueMatcher(T value) { } + protected T Value { get; } + } + public class VersionMatcher : MockHttp.Matchers.ValueMatcher + { + public VersionMatcher(System.Version version) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } +} +namespace MockHttp.Responses +{ + public interface IResponseBehavior + { + System.Threading.Tasks.Task HandleAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, MockHttp.Responses.ResponseHandlerDelegate next, System.Threading.CancellationToken cancellationToken); + } + public interface IResponseStrategy + { + System.Threading.Tasks.Task ProduceResponseAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Threading.CancellationToken cancellationToken); + } + public class MockHttpRequestContext + { + public MockHttpRequestContext(System.Net.Http.HttpRequestMessage request, System.Collections.Generic.IReadOnlyDictionary? services = null) { } + public System.Net.Http.HttpRequestMessage Request { get; } + public System.Collections.Generic.IReadOnlyDictionary Services { get; } + public bool TryGetService([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out TService? service) { } + } + public delegate System.Threading.Tasks.Task ResponseHandlerDelegate(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, System.Threading.CancellationToken cancellationToken); +} +namespace MockHttp.Threading +{ + public interface IConcurrentReadOnlyCollection : System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable { } +} \ No newline at end of file diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt new file mode 100644 index 00000000..e7a90c93 --- /dev/null +++ b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Framework_4.8.verified.txt @@ -0,0 +1,504 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName=".NET Framework 4.8")] +namespace MockHttp +{ + public static class AuthenticationRequestMatchingExtensions + { + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder, string token) { } + } + public sealed class BitRate + { + public override string ToString() { } + public static MockHttp.BitRate FiveG() { } + public static MockHttp.BitRate FourG() { } + public static MockHttp.BitRate FromInt32(int bitRate) { } + public static MockHttp.BitRate OneGigabit() { } + public static MockHttp.BitRate OneHundredMegabit() { } + public static MockHttp.BitRate TenMegabit() { } + public static MockHttp.BitRate ThreeG() { } + public static int ToInt32(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate TwoG() { } + public static int op_Explicit(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate op_Explicit(int bitRate) { } + } + [System.Serializable] + public class HttpMockException : System.Exception + { + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + protected HttpMockException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + } + public interface IFluentInterface + { + bool Equals(object obj); + int GetHashCode(); + System.Type GetType(); + string ToString(); + } + public interface IInvokedHttpRequest + { + System.Collections.Generic.IReadOnlyCollection Matchers { get; } + System.Net.Http.HttpRequestMessage Request { get; } + } + public interface IInvokedHttpRequestCollection : MockHttp.Threading.IConcurrentReadOnlyCollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable + { + void Clear(); + } + public interface IMockConfiguration + { + System.Collections.Generic.IReadOnlyDictionary Items { get; } + MockHttp.IMockConfiguration Use(TService service); + } + public static class IRespondsExtensions + { + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + } + public interface IResponseBuilder : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse, MockHttp.Language.Response.IWithStatusCode { } + public sealed class IsSent + { + public override string ToString() { } + public static MockHttp.IsSent AtLeast(int callCount) { } + public static MockHttp.IsSent AtLeastOnce() { } + public static MockHttp.IsSent AtMost(int callCount) { } + public static MockHttp.IsSent AtMostOnce() { } + public static MockHttp.IsSent Exactly(int callCount) { } + public static MockHttp.IsSent Never() { } + public static MockHttp.IsSent Once() { } + } + public sealed class MockHttpHandler : System.Net.Http.HttpMessageHandler, MockHttp.IMockConfiguration + { + public static readonly System.Text.Encoding DefaultEncoding; + public MockHttpHandler() { } + public MockHttp.Language.IRespondsThrows Fallback { get; } + public MockHttp.IInvokedHttpRequestCollection InvokedRequests { get; } + public void Reset() { } + protected override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { } + public void Verify() { } + public void Verify(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public void Verify(System.Action matching, System.Func times, string? because = null) { } + public void VerifyAll() { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, System.Func times, string? because = null) { } + public void VerifyNoOtherRequests() { } + public MockHttp.Language.IConfiguredRequest When(System.Action matching) { } + } + public class NetworkLatency + { + public override string ToString() { } + public static MockHttp.NetworkLatency Around(int latencyInMs) { } + public static MockHttp.NetworkLatency Around(System.TimeSpan latency) { } + public static MockHttp.NetworkLatency Between(int minMs, int maxMs) { } + public static MockHttp.NetworkLatency Between(System.TimeSpan min, System.TimeSpan max) { } + public static MockHttp.NetworkLatency FiveG() { } + public static MockHttp.NetworkLatency FourG() { } + public static MockHttp.NetworkLatency ThreeG() { } + public static MockHttp.NetworkLatency TwoG() { } + } + public class RequestMatching : MockHttp.IFluentInterface + { + public MockHttp.RequestMatching Not { get; } + protected virtual MockHttp.RequestMatching RegisterMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + protected virtual void ValidateMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + public MockHttp.RequestMatching With(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching Any(this MockHttp.RequestMatching builder, System.Action anyBuilder) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, byte[] body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, System.IO.Stream body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, System.Net.Http.Headers.MediaTypeHeaderValue mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string contentType, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string urlEncodedFormData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string key, string value) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTime date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTimeOffset date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, params string[] values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, string value, bool allowWildcards) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, T value) + where T : struct { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, string headers) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, System.Net.Http.HttpMethod method) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, string httpMethod) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, byte[] partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, System.IO.Stream partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string queryString) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, params string[] values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, string? value) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, string requestUri) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, System.Uri requestUri) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, string version) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, System.Version version) { } + public static MockHttp.RequestMatching Where(this MockHttp.RequestMatching builder, System.Linq.Expressions.Expression> expression) { } + public static MockHttp.RequestMatching WithoutBody(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching WithoutQueryString(this MockHttp.RequestMatching builder) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func> streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.IO.Stream streamContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Net.Http.HttpContent httpContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, string textContent, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent, int offset, int count) { } + public static MockHttp.Language.Response.IWithResponse ClientTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(this MockHttp.Language.Response.IWithContentType builder, string mediaType, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair> header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, System.Collections.Generic.IEnumerable value) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, params T[] value) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, MockHttp.NetworkLatency latency) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, System.Func latency) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult ServerTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(this MockHttp.Language.Response.IWithStatusCode builder, int statusCode, string? reasonPhrase = null) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, MockHttp.BitRate bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, System.Func bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, int bitRate) { } + } + public static class ResponseBuilderLinqToXmlExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult XmlBody(this MockHttp.Language.Response.IWithContent builder, System.Xml.Linq.XContainer xmlContent, System.Xml.XmlWriterSettings? settings = null) { } + } +} +namespace MockHttp.Http +{ + public static class HeaderNames + { + public const string Accept = "Accept"; + public const string AcceptCharset = "Accept-Charset"; + public const string AcceptEncoding = "Accept-Encoding"; + public const string AcceptLanguage = "Accept-Language"; + public const string AcceptRanges = "Accept-Ranges"; + public const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials"; + public const string AccessControlAllowHeaders = "Access-Control-Allow-Headers"; + public const string AccessControlAllowMethods = "Access-Control-Allow-Methods"; + public const string AccessControlAllowOrigin = "Access-Control-Allow-Origin"; + public const string AccessControlExposeHeaders = "Access-Control-Expose-Headers"; + public const string AccessControlMaxAge = "Access-Control-Max-Age"; + public const string AccessControlRequestHeaders = "Access-Control-Request-Headers"; + public const string AccessControlRequestMethod = "Access-Control-Request-Method"; + public const string Age = "Age"; + public const string Allow = "Allow"; + public const string Authority = ":authority"; + public const string Authorization = "Authorization"; + public const string CacheControl = "Cache-Control"; + public const string Connection = "Connection"; + public const string ContentDisposition = "Content-Disposition"; + public const string ContentEncoding = "Content-Encoding"; + public const string ContentLanguage = "Content-Language"; + public const string ContentLength = "Content-Length"; + public const string ContentLocation = "Content-Location"; + public const string ContentMD5 = "Content-MD5"; + public const string ContentRange = "Content-Range"; + public const string ContentSecurityPolicy = "Content-Security-Policy"; + public const string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"; + public const string ContentType = "Content-Type"; + public const string Cookie = "Cookie"; + public const string CorrelationContext = "Correlation-Context"; + public const string DNT = "DNT"; + public const string Date = "Date"; + public const string ETag = "ETag"; + public const string Expect = "Expect"; + public const string Expires = "Expires"; + public const string From = "From"; + public const string Host = "Host"; + public const string IfMatch = "If-Match"; + public const string IfModifiedSince = "If-Modified-Since"; + public const string IfNoneMatch = "If-None-Match"; + public const string IfRange = "If-Range"; + public const string IfUnmodifiedSince = "If-Unmodified-Since"; + public const string KeepAlive = "Keep-Alive"; + public const string LastModified = "Last-Modified"; + public const string Location = "Location"; + public const string MaxForwards = "Max-Forwards"; + public const string Method = ":method"; + public const string Origin = "Origin"; + public const string Path = ":path"; + public const string Pragma = "Pragma"; + public const string ProxyAuthenticate = "Proxy-Authenticate"; + public const string ProxyAuthorization = "Proxy-Authorization"; + public const string Range = "Range"; + public const string Referer = "Referer"; + public const string RequestId = "Request-Id"; + public const string RetryAfter = "Retry-After"; + public const string Scheme = ":scheme"; + public const string SecWebSocketAccept = "Sec-WebSocket-Accept"; + public const string SecWebSocketKey = "Sec-WebSocket-Key"; + public const string SecWebSocketProtocol = "Sec-WebSocket-Protocol"; + public const string SecWebSocketVersion = "Sec-WebSocket-Version"; + public const string Server = "Server"; + public const string SetCookie = "Set-Cookie"; + public const string Status = ":status"; + public const string StrictTransportSecurity = "Strict-Transport-Security"; + public const string TE = "TE"; + public const string TraceParent = "traceparent"; + public const string TraceState = "tracestate"; + public const string Trailer = "Trailer"; + public const string TransferEncoding = "Transfer-Encoding"; + public const string Translate = "Translate"; + public const string Upgrade = "Upgrade"; + public const string UpgradeInsecureRequests = "Upgrade-Insecure-Requests"; + public const string UserAgent = "User-Agent"; + public const string Vary = "Vary"; + public const string Via = "Via"; + public const string WWWAuthenticate = "WWW-Authenticate"; + public const string Warning = "Warning"; + public const string WebSocketSubProtocols = "Sec-WebSocket-Protocol"; + public const string XFrameOptions = "X-Frame-Options"; + } + public static class MediaTypes + { + public const string FormUrlEncoded = "application/x-www-form-urlencoded"; + public const string Html = "text/html"; + public const string Json = "application/json"; + public const string JsonProblemDetails = "application/problem+json"; + public const string MultipartFormData = "multipart/form-data"; + public const string OctetStream = "application/octet-stream"; + public const string PlainText = "text/plain"; + public const string Xml = "application/xml"; + public const string XmlProblemDetails = "application/problem+xml"; + } +} +namespace MockHttp.IO +{ + public class RateLimitedStream : System.IO.Stream + { + public RateLimitedStream(System.IO.Stream actualStream, int bitRate, bool leaveOpen = false) { } + public override bool CanRead { get; } + public override bool CanSeek { get; } + public override bool CanWrite { get; } + public override long Length { get; } + public override long Position { get; set; } + protected override void Dispose(bool disposing) { } + public override void Flush() { } + public override int Read(byte[] buffer, int offset, int count) { } + public override long Seek(long offset, System.IO.SeekOrigin origin) { } + public override void SetLength(long value) { } + public override void Write(byte[] buffer, int offset, int count) { } + } +} +namespace MockHttp.Language.Flow +{ + public interface ICallbackResult : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult { } + public interface IResponseResult : MockHttp.IFluentInterface { } + public interface ISequenceResponseResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface ISequenceThrowsResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IThrowsResult : MockHttp.IFluentInterface { } +} +namespace MockHttp.Language.Flow.Response +{ + public interface IWithContentResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContentType, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithHeadersResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithStatusCodeResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } +} +namespace MockHttp.Language +{ + public interface ICallback : MockHttp.IFluentInterface + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult + { + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + } + public interface IConfiguredRequest : MockHttp.IFluentInterface, MockHttp.Language.Flow.ICallbackResult, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.Flow.ISequenceResponseResult, MockHttp.Language.Flow.ISequenceThrowsResult, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.ICallback, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IRespondsThrows : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows { } + public interface IResponds : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IResponseResult + { + TResult RespondUsing(MockHttp.Responses.IResponseStrategy responseStrategy); + } + public interface IThrows : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IThrowsResult + { + TResult Throws(System.Exception exception); + TResult Throws() + where TException : System.Exception, new (); + } + public interface IVerifies : MockHttp.IFluentInterface + { + void Verifiable(); + void Verifiable(string because); + } +} +namespace MockHttp.Language.Response +{ + public interface IWithContent : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithContentResult Body(System.Func> httpContentFactory); + } + public interface IWithContentType : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(System.Net.Http.Headers.MediaTypeHeaderValue mediaType); + } + public interface IWithHeaders : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult Headers(System.Collections.Generic.IEnumerable>> headers); + } + public interface IWithResponse : MockHttp.IFluentInterface + { + System.Collections.Generic.IList Behaviors { get; } + } + public interface IWithStatusCode : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(System.Net.HttpStatusCode statusCode, string? reasonPhrase = null); + } +} +namespace MockHttp.Matchers +{ + public class AnyMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public AnyMatcher(System.Collections.Generic.IReadOnlyCollection matchers) { } + public bool IsExclusive { get; } + public System.Collections.Generic.IReadOnlyCollection Matchers { get; } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ContentMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public ContentMatcher() { } + public ContentMatcher(byte[] content) { } + public ContentMatcher(string content, System.Text.Encoding? encoding) { } + protected System.Collections.Generic.IReadOnlyList ByteContent { get; } + public virtual bool IsExclusive { get; } + protected virtual bool IsMatch(byte[] requestContent) { } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ExpressionMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public ExpressionMatcher(System.Linq.Expressions.Expression> expression) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class FormDataMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public FormDataMatcher(System.Collections.Generic.IEnumerable>> formData) { } + public FormDataMatcher(string urlEncodedFormData) { } + public virtual bool IsExclusive { get; } + public virtual System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpHeadersMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable>> headers) { } + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable> headers) { } + public HttpHeadersMatcher(string name) { } + public HttpHeadersMatcher(string name, System.Collections.Generic.IEnumerable values) { } + public HttpHeadersMatcher(string name, string value, bool allowWildcards = false) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpMethodMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpMethodMatcher(System.Net.Http.HttpMethod method) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class HttpRequestMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + protected HttpRequestMatcher() { } + public virtual bool IsExclusive { get; } + public abstract bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext); + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public abstract override string ToString() { } + } + public interface IAsyncHttpRequestMatcher + { + bool IsExclusive { get; } + System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext); + } + public class MediaTypeHeaderMatcher : MockHttp.Matchers.ValueMatcher + { + public MediaTypeHeaderMatcher(System.Net.Http.Headers.MediaTypeHeaderValue headerValue) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class PartialContentMatcher : MockHttp.Matchers.ContentMatcher + { + public PartialContentMatcher(byte[] content) { } + public PartialContentMatcher(string content, System.Text.Encoding? encoding) { } + public override bool IsExclusive { get; } + protected override bool IsMatch(byte[] requestContent) { } + public override string ToString() { } + } + public class QueryStringMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public QueryStringMatcher(System.Collections.Generic.IEnumerable>> parameters) { } + public QueryStringMatcher(string queryString) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + [System.Obsolete("Replaced with UriMatcher. Will be removed in next major release.")] + public class RequestUriMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public RequestUriMatcher(System.Uri uri) { } + public RequestUriMatcher(string uriString, bool allowWildcards = true) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class ValueMatcher : MockHttp.Matchers.HttpRequestMatcher + { + protected ValueMatcher(T value) { } + protected T Value { get; } + } + public class VersionMatcher : MockHttp.Matchers.ValueMatcher + { + public VersionMatcher(System.Version version) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } +} +namespace MockHttp.Responses +{ + public interface IResponseBehavior + { + System.Threading.Tasks.Task HandleAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, MockHttp.Responses.ResponseHandlerDelegate next, System.Threading.CancellationToken cancellationToken); + } + public interface IResponseStrategy + { + System.Threading.Tasks.Task ProduceResponseAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Threading.CancellationToken cancellationToken); + } + public class MockHttpRequestContext + { + public MockHttpRequestContext(System.Net.Http.HttpRequestMessage request, System.Collections.Generic.IReadOnlyDictionary? services = null) { } + public System.Net.Http.HttpRequestMessage Request { get; } + public System.Collections.Generic.IReadOnlyDictionary Services { get; } + public bool TryGetService([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out TService? service) { } + } + public delegate System.Threading.Tasks.Task ResponseHandlerDelegate(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, System.Threading.CancellationToken cancellationToken); +} +namespace MockHttp.Threading +{ + public interface IConcurrentReadOnlyCollection : System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable { } +} \ No newline at end of file diff --git a/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt new file mode 100644 index 00000000..6f89197d --- /dev/null +++ b/test/MockHttp.Tests/PublicApiTests.Api_has_not_changed.NET_Standard_2.1.verified.txt @@ -0,0 +1,504 @@ +[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/skwasjer/MockHttp")] +[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName=".NET Standard 2.1")] +namespace MockHttp +{ + public static class AuthenticationRequestMatchingExtensions + { + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching BearerToken(this MockHttp.RequestMatching builder, string token) { } + } + public sealed class BitRate + { + public override string ToString() { } + public static MockHttp.BitRate FiveG() { } + public static MockHttp.BitRate FourG() { } + public static MockHttp.BitRate FromInt32(int bitRate) { } + public static MockHttp.BitRate OneGigabit() { } + public static MockHttp.BitRate OneHundredMegabit() { } + public static MockHttp.BitRate TenMegabit() { } + public static MockHttp.BitRate ThreeG() { } + public static int ToInt32(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate TwoG() { } + public static int op_Explicit(MockHttp.BitRate bitRate) { } + public static MockHttp.BitRate op_Explicit(int bitRate) { } + } + [System.Serializable] + public class HttpMockException : System.Exception + { + [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + protected HttpMockException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + } + public interface IFluentInterface + { + bool Equals(object obj); + int GetHashCode(); + System.Type GetType(); + string ToString(); + } + public interface IInvokedHttpRequest + { + System.Collections.Generic.IReadOnlyCollection Matchers { get; } + System.Net.Http.HttpRequestMessage Request { get; } + } + public interface IInvokedHttpRequestCollection : MockHttp.Threading.IConcurrentReadOnlyCollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable + { + void Clear(); + } + public interface IMockConfiguration + { + System.Collections.Generic.IReadOnlyDictionary Items { get; } + MockHttp.IMockConfiguration Use(TService service); + } + public static class IRespondsExtensions + { + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Action with) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + public static TResult Respond(this MockHttp.Language.IResponds responds, System.Func response) + where TResult : MockHttp.Language.Flow.IResponseResult { } + } + public interface IResponseBuilder : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse, MockHttp.Language.Response.IWithStatusCode { } + public sealed class IsSent + { + public override string ToString() { } + public static MockHttp.IsSent AtLeast(int callCount) { } + public static MockHttp.IsSent AtLeastOnce() { } + public static MockHttp.IsSent AtMost(int callCount) { } + public static MockHttp.IsSent AtMostOnce() { } + public static MockHttp.IsSent Exactly(int callCount) { } + public static MockHttp.IsSent Never() { } + public static MockHttp.IsSent Once() { } + } + public sealed class MockHttpHandler : System.Net.Http.HttpMessageHandler, MockHttp.IMockConfiguration + { + public static readonly System.Text.Encoding DefaultEncoding; + public MockHttpHandler() { } + public MockHttp.Language.IRespondsThrows Fallback { get; } + public MockHttp.IInvokedHttpRequestCollection InvokedRequests { get; } + public void Reset() { } + protected override System.Threading.Tasks.Task SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { } + public void Verify() { } + public void Verify(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public void Verify(System.Action matching, System.Func times, string? because = null) { } + public void VerifyAll() { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, MockHttp.IsSent times, string? because = null) { } + public System.Threading.Tasks.Task VerifyAsync(System.Action matching, System.Func times, string? because = null) { } + public void VerifyNoOtherRequests() { } + public MockHttp.Language.IConfiguredRequest When(System.Action matching) { } + } + public class NetworkLatency + { + public override string ToString() { } + public static MockHttp.NetworkLatency Around(int latencyInMs) { } + public static MockHttp.NetworkLatency Around(System.TimeSpan latency) { } + public static MockHttp.NetworkLatency Between(int minMs, int maxMs) { } + public static MockHttp.NetworkLatency Between(System.TimeSpan min, System.TimeSpan max) { } + public static MockHttp.NetworkLatency FiveG() { } + public static MockHttp.NetworkLatency FourG() { } + public static MockHttp.NetworkLatency ThreeG() { } + public static MockHttp.NetworkLatency TwoG() { } + } + public class RequestMatching : MockHttp.IFluentInterface + { + public MockHttp.RequestMatching Not { get; } + protected virtual MockHttp.RequestMatching RegisterMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + protected virtual void ValidateMatcher(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + public MockHttp.RequestMatching With(MockHttp.Matchers.IAsyncHttpRequestMatcher matcher) { } + } + public static class RequestMatchingExtensions + { + public static MockHttp.RequestMatching Any(this MockHttp.RequestMatching builder, System.Action anyBuilder) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, byte[] body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, System.IO.Stream body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body) { } + public static MockHttp.RequestMatching Body(this MockHttp.RequestMatching builder, string body, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, System.Net.Http.Headers.MediaTypeHeaderValue mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string mediaType) { } + public static MockHttp.RequestMatching ContentType(this MockHttp.RequestMatching builder, string contentType, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection formData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string urlEncodedFormData) { } + public static MockHttp.RequestMatching FormData(this MockHttp.RequestMatching builder, string key, string value) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTime date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, System.DateTimeOffset date) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, params string[] values) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, string value, bool allowWildcards) { } + public static MockHttp.RequestMatching Header(this MockHttp.RequestMatching builder, string name, T value) + where T : struct { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable> headers) { } + public static MockHttp.RequestMatching Headers(this MockHttp.RequestMatching builder, string headers) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, System.Net.Http.HttpMethod method) { } + public static MockHttp.RequestMatching Method(this MockHttp.RequestMatching builder, string httpMethod) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, byte[] partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, System.IO.Stream partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody) { } + public static MockHttp.RequestMatching PartialBody(this MockHttp.RequestMatching builder, string partialBody, System.Text.Encoding encoding) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Generic.IEnumerable>> parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, System.Collections.Specialized.NameValueCollection parameters) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string queryString) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, System.Collections.Generic.IEnumerable values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, params string[] values) { } + public static MockHttp.RequestMatching QueryString(this MockHttp.RequestMatching builder, string key, string? value) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, string requestUri) { } + public static MockHttp.RequestMatching RequestUri(this MockHttp.RequestMatching builder, System.Uri requestUri) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, string version) { } + public static MockHttp.RequestMatching Version(this MockHttp.RequestMatching builder, System.Version version) { } + public static MockHttp.RequestMatching Where(this MockHttp.RequestMatching builder, System.Linq.Expressions.Expression> expression) { } + public static MockHttp.RequestMatching WithoutBody(this MockHttp.RequestMatching builder) { } + public static MockHttp.RequestMatching WithoutQueryString(this MockHttp.RequestMatching builder) { } + } + public static class ResponseBuilderExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Func> streamContentFactory) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.IO.Stream streamContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, System.Net.Http.HttpContent httpContent) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, string textContent, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithContentResult Body(this MockHttp.Language.Response.IWithContent builder, byte[] binaryContent, int offset, int count) { } + public static MockHttp.Language.Response.IWithResponse ClientTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(this MockHttp.Language.Response.IWithContentType builder, string mediaType, System.Text.Encoding? encoding = null) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair> header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, System.Collections.Generic.KeyValuePair header) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, System.Collections.Generic.IEnumerable value) { } + public static MockHttp.Language.Flow.Response.IWithHeadersResult Header(this MockHttp.Language.Response.IWithHeaders builder, string name, params T[] value) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, MockHttp.NetworkLatency latency) { } + public static MockHttp.Language.Response.IWithResponse Latency(this MockHttp.Language.Response.IWithResponse builder, System.Func latency) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult ServerTimeout(this MockHttp.IResponseBuilder builder, System.TimeSpan? timeoutAfter = default) { } + public static MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(this MockHttp.Language.Response.IWithStatusCode builder, int statusCode, string? reasonPhrase = null) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, MockHttp.BitRate bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, System.Func bitRate) { } + public static MockHttp.Language.Response.IWithResponse TransferRate(this MockHttp.Language.Response.IWithResponse builder, int bitRate) { } + } + public static class ResponseBuilderLinqToXmlExtensions + { + public static MockHttp.Language.Flow.Response.IWithContentResult XmlBody(this MockHttp.Language.Response.IWithContent builder, System.Xml.Linq.XContainer xmlContent, System.Xml.XmlWriterSettings? settings = null) { } + } +} +namespace MockHttp.Http +{ + public static class HeaderNames + { + public const string Accept = "Accept"; + public const string AcceptCharset = "Accept-Charset"; + public const string AcceptEncoding = "Accept-Encoding"; + public const string AcceptLanguage = "Accept-Language"; + public const string AcceptRanges = "Accept-Ranges"; + public const string AccessControlAllowCredentials = "Access-Control-Allow-Credentials"; + public const string AccessControlAllowHeaders = "Access-Control-Allow-Headers"; + public const string AccessControlAllowMethods = "Access-Control-Allow-Methods"; + public const string AccessControlAllowOrigin = "Access-Control-Allow-Origin"; + public const string AccessControlExposeHeaders = "Access-Control-Expose-Headers"; + public const string AccessControlMaxAge = "Access-Control-Max-Age"; + public const string AccessControlRequestHeaders = "Access-Control-Request-Headers"; + public const string AccessControlRequestMethod = "Access-Control-Request-Method"; + public const string Age = "Age"; + public const string Allow = "Allow"; + public const string Authority = ":authority"; + public const string Authorization = "Authorization"; + public const string CacheControl = "Cache-Control"; + public const string Connection = "Connection"; + public const string ContentDisposition = "Content-Disposition"; + public const string ContentEncoding = "Content-Encoding"; + public const string ContentLanguage = "Content-Language"; + public const string ContentLength = "Content-Length"; + public const string ContentLocation = "Content-Location"; + public const string ContentMD5 = "Content-MD5"; + public const string ContentRange = "Content-Range"; + public const string ContentSecurityPolicy = "Content-Security-Policy"; + public const string ContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"; + public const string ContentType = "Content-Type"; + public const string Cookie = "Cookie"; + public const string CorrelationContext = "Correlation-Context"; + public const string DNT = "DNT"; + public const string Date = "Date"; + public const string ETag = "ETag"; + public const string Expect = "Expect"; + public const string Expires = "Expires"; + public const string From = "From"; + public const string Host = "Host"; + public const string IfMatch = "If-Match"; + public const string IfModifiedSince = "If-Modified-Since"; + public const string IfNoneMatch = "If-None-Match"; + public const string IfRange = "If-Range"; + public const string IfUnmodifiedSince = "If-Unmodified-Since"; + public const string KeepAlive = "Keep-Alive"; + public const string LastModified = "Last-Modified"; + public const string Location = "Location"; + public const string MaxForwards = "Max-Forwards"; + public const string Method = ":method"; + public const string Origin = "Origin"; + public const string Path = ":path"; + public const string Pragma = "Pragma"; + public const string ProxyAuthenticate = "Proxy-Authenticate"; + public const string ProxyAuthorization = "Proxy-Authorization"; + public const string Range = "Range"; + public const string Referer = "Referer"; + public const string RequestId = "Request-Id"; + public const string RetryAfter = "Retry-After"; + public const string Scheme = ":scheme"; + public const string SecWebSocketAccept = "Sec-WebSocket-Accept"; + public const string SecWebSocketKey = "Sec-WebSocket-Key"; + public const string SecWebSocketProtocol = "Sec-WebSocket-Protocol"; + public const string SecWebSocketVersion = "Sec-WebSocket-Version"; + public const string Server = "Server"; + public const string SetCookie = "Set-Cookie"; + public const string Status = ":status"; + public const string StrictTransportSecurity = "Strict-Transport-Security"; + public const string TE = "TE"; + public const string TraceParent = "traceparent"; + public const string TraceState = "tracestate"; + public const string Trailer = "Trailer"; + public const string TransferEncoding = "Transfer-Encoding"; + public const string Translate = "Translate"; + public const string Upgrade = "Upgrade"; + public const string UpgradeInsecureRequests = "Upgrade-Insecure-Requests"; + public const string UserAgent = "User-Agent"; + public const string Vary = "Vary"; + public const string Via = "Via"; + public const string WWWAuthenticate = "WWW-Authenticate"; + public const string Warning = "Warning"; + public const string WebSocketSubProtocols = "Sec-WebSocket-Protocol"; + public const string XFrameOptions = "X-Frame-Options"; + } + public static class MediaTypes + { + public const string FormUrlEncoded = "application/x-www-form-urlencoded"; + public const string Html = "text/html"; + public const string Json = "application/json"; + public const string JsonProblemDetails = "application/problem+json"; + public const string MultipartFormData = "multipart/form-data"; + public const string OctetStream = "application/octet-stream"; + public const string PlainText = "text/plain"; + public const string Xml = "application/xml"; + public const string XmlProblemDetails = "application/problem+xml"; + } +} +namespace MockHttp.IO +{ + public class RateLimitedStream : System.IO.Stream + { + public RateLimitedStream(System.IO.Stream actualStream, int bitRate, bool leaveOpen = false) { } + public override bool CanRead { get; } + public override bool CanSeek { get; } + public override bool CanWrite { get; } + public override long Length { get; } + public override long Position { get; set; } + protected override void Dispose(bool disposing) { } + public override void Flush() { } + public override int Read(byte[] buffer, int offset, int count) { } + public override long Seek(long offset, System.IO.SeekOrigin origin) { } + public override void SetLength(long value) { } + public override void Write(byte[] buffer, int offset, int count) { } + } +} +namespace MockHttp.Language.Flow +{ + public interface ICallbackResult : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult { } + public interface IResponseResult : MockHttp.IFluentInterface { } + public interface ISequenceResponseResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface ISequenceThrowsResult : MockHttp.IFluentInterface, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IThrowsResult : MockHttp.IFluentInterface { } +} +namespace MockHttp.Language.Flow.Response +{ + public interface IWithContentResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContentType, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithHeadersResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } + public interface IWithStatusCodeResult : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithHeaders, MockHttp.Language.Response.IWithResponse { } +} +namespace MockHttp.Language +{ + public interface ICallback : MockHttp.IFluentInterface + where out TResponseResult : MockHttp.Language.Flow.IResponseResult + where out TThrowsResult : MockHttp.Language.Flow.IThrowsResult + { + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + MockHttp.Language.Flow.ICallbackResult Callback(System.Action callback); + } + public interface IConfiguredRequest : MockHttp.IFluentInterface, MockHttp.Language.Flow.ICallbackResult, MockHttp.Language.Flow.IResponseResult, MockHttp.Language.Flow.ISequenceResponseResult, MockHttp.Language.Flow.ISequenceThrowsResult, MockHttp.Language.Flow.IThrowsResult, MockHttp.Language.ICallback, MockHttp.Language.IResponds, MockHttp.Language.IThrows, MockHttp.Language.IVerifies { } + public interface IRespondsThrows : MockHttp.IFluentInterface, MockHttp.Language.IResponds, MockHttp.Language.IThrows { } + public interface IResponds : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IResponseResult + { + TResult RespondUsing(MockHttp.Responses.IResponseStrategy responseStrategy); + } + public interface IThrows : MockHttp.IFluentInterface + where out TResult : MockHttp.Language.Flow.IThrowsResult + { + TResult Throws(System.Exception exception); + TResult Throws() + where TException : System.Exception, new (); + } + public interface IVerifies : MockHttp.IFluentInterface + { + void Verifiable(); + void Verifiable(string because); + } +} +namespace MockHttp.Language.Response +{ + public interface IWithContent : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithContentResult Body(System.Func> httpContentFactory); + } + public interface IWithContentType : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult ContentType(System.Net.Http.Headers.MediaTypeHeaderValue mediaType); + } + public interface IWithHeaders : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithHeadersResult Headers(System.Collections.Generic.IEnumerable>> headers); + } + public interface IWithResponse : MockHttp.IFluentInterface + { + System.Collections.Generic.IList Behaviors { get; } + } + public interface IWithStatusCode : MockHttp.IFluentInterface, MockHttp.Language.Response.IWithContent, MockHttp.Language.Response.IWithResponse + { + MockHttp.Language.Flow.Response.IWithStatusCodeResult StatusCode(System.Net.HttpStatusCode statusCode, string? reasonPhrase = null); + } +} +namespace MockHttp.Matchers +{ + public class AnyMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public AnyMatcher(System.Collections.Generic.IReadOnlyCollection matchers) { } + public bool IsExclusive { get; } + public System.Collections.Generic.IReadOnlyCollection Matchers { get; } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ContentMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public ContentMatcher() { } + public ContentMatcher(byte[] content) { } + public ContentMatcher(string content, System.Text.Encoding? encoding) { } + protected System.Collections.Generic.IReadOnlyList ByteContent { get; } + public virtual bool IsExclusive { get; } + protected virtual bool IsMatch(byte[] requestContent) { } + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class ExpressionMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public ExpressionMatcher(System.Linq.Expressions.Expression> expression) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class FormDataMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + public FormDataMatcher(System.Collections.Generic.IEnumerable>> formData) { } + public FormDataMatcher(string urlEncodedFormData) { } + public virtual bool IsExclusive { get; } + public virtual System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpHeadersMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable>> headers) { } + public HttpHeadersMatcher(System.Collections.Generic.IEnumerable> headers) { } + public HttpHeadersMatcher(string name) { } + public HttpHeadersMatcher(string name, System.Collections.Generic.IEnumerable values) { } + public HttpHeadersMatcher(string name, string value, bool allowWildcards = false) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class HttpMethodMatcher : MockHttp.Matchers.ValueMatcher + { + public HttpMethodMatcher(System.Net.Http.HttpMethod method) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class HttpRequestMatcher : MockHttp.Matchers.IAsyncHttpRequestMatcher + { + protected HttpRequestMatcher() { } + public virtual bool IsExclusive { get; } + public abstract bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext); + public System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public abstract override string ToString() { } + } + public interface IAsyncHttpRequestMatcher + { + bool IsExclusive { get; } + System.Threading.Tasks.Task IsMatchAsync(MockHttp.Responses.MockHttpRequestContext requestContext); + } + public class MediaTypeHeaderMatcher : MockHttp.Matchers.ValueMatcher + { + public MediaTypeHeaderMatcher(System.Net.Http.Headers.MediaTypeHeaderValue headerValue) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public class PartialContentMatcher : MockHttp.Matchers.ContentMatcher + { + public PartialContentMatcher(byte[] content) { } + public PartialContentMatcher(string content, System.Text.Encoding? encoding) { } + public override bool IsExclusive { get; } + protected override bool IsMatch(byte[] requestContent) { } + public override string ToString() { } + } + public class QueryStringMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public QueryStringMatcher(System.Collections.Generic.IEnumerable>> parameters) { } + public QueryStringMatcher(string queryString) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + [System.Obsolete("Replaced with UriMatcher. Will be removed in next major release.")] + public class RequestUriMatcher : MockHttp.Matchers.HttpRequestMatcher + { + public RequestUriMatcher(System.Uri uri) { } + public RequestUriMatcher(string uriString, bool allowWildcards = true) { } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } + public abstract class ValueMatcher : MockHttp.Matchers.HttpRequestMatcher + { + protected ValueMatcher(T value) { } + protected T Value { get; } + } + public class VersionMatcher : MockHttp.Matchers.ValueMatcher + { + public VersionMatcher(System.Version version) { } + public override bool IsExclusive { get; } + public override bool IsMatch(MockHttp.Responses.MockHttpRequestContext requestContext) { } + public override string ToString() { } + } +} +namespace MockHttp.Responses +{ + public interface IResponseBehavior + { + System.Threading.Tasks.Task HandleAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, MockHttp.Responses.ResponseHandlerDelegate next, System.Threading.CancellationToken cancellationToken); + } + public interface IResponseStrategy + { + System.Threading.Tasks.Task ProduceResponseAsync(MockHttp.Responses.MockHttpRequestContext requestContext, System.Threading.CancellationToken cancellationToken); + } + public class MockHttpRequestContext + { + public MockHttpRequestContext(System.Net.Http.HttpRequestMessage request, System.Collections.Generic.IReadOnlyDictionary? services = null) { } + public System.Net.Http.HttpRequestMessage Request { get; } + public System.Collections.Generic.IReadOnlyDictionary Services { get; } + public bool TryGetService([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out TService? service) { } + } + public delegate System.Threading.Tasks.Task ResponseHandlerDelegate(MockHttp.Responses.MockHttpRequestContext requestContext, System.Net.Http.HttpResponseMessage responseMessage, System.Threading.CancellationToken cancellationToken); +} +namespace MockHttp.Threading +{ + public interface IConcurrentReadOnlyCollection : System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.Generic.IReadOnlyList, System.Collections.IEnumerable { } +} \ No newline at end of file diff --git a/test/MockHttp.Tests/PublicApiTests.cs b/test/MockHttp.Tests/PublicApiTests.cs new file mode 100644 index 00000000..83785b15 --- /dev/null +++ b/test/MockHttp.Tests/PublicApiTests.cs @@ -0,0 +1,12 @@ + +using MockHttp.Specs; + +namespace MockHttp; + +public sealed class PublicApiTests : PublicApiSpec +{ + public PublicApiTests() + : base(typeof(MockHttpHandler)) + { + } +}