A C# .NET version based on mock4net which mimics the functionality from the JAVA based WireMock.org.
For more info, see also this WIKI page: What is WireMock.Net.
Project | |
Chat | |
Issues | |
Quality | |
Build Azure | |
Quality | |
Sonar Bugs | |
Coverage |
Official | Preview | |
---|---|---|
WireMock.Net | ||
WireMock.Net.StandAlone | ||
WireMock.Net.FluentAssertions | ||
WireMock.Net.Matchers.CSharpCode | ||
WireMock.Net.OpenApiParser | ||
WireMock.Net.RestClient | ||
WireMock.Org.RestClient |
For the supported frameworks and build information, see this page.
A core feature of WireMock.Net is the ability to return predefined HTTP responses for requests matching criteria.See Wiki : Stubbing.
WireMock.Net support advanced request-matching logic, see Wiki : Request Matching.
The response which is returned WireMock.Net can be changed using templating. This is described here Wiki : Response Templating.
The WireMock admin API provides functionality to define the mappings via a http interface see Wiki : Admin API Reference.
WireMock.Net can be used in several ways:
You can use your favorite test framework and use WireMock within your tests, seeWiki : UnitTesting.
It's simple to install WireMock.Net as (global) dotnet tool, see Wiki : dotnet tool.
This is quite straight forward to launch a mock server within a console application, see Wiki : Standalone Process.
You can also run WireMock.Net as a Windows Service, follow this WireMock-as-a-Windows-Service.
See this link WireMock-as-a-(Azure)-Web-App
There is also a Linux and Windows-Nano container available at hub.docker.com.For more details see also Docker.
More details on using HTTPS (SSL) can be found here Wiki : HTTPS
目录 介绍 背景 使用代码 兴趣点 从 GitHub下载完整的源代码 介绍 如果您是执行TDD的ASP.NET Core开发人员,您可能会遇到一些问题。您的测试不涵盖您的Program类和Startup类。您的模拟框架有助于模拟内部依赖项,但不能模拟外部依赖项,例如其他公司制作的Web服务。此外,也许您决定不测试某些类,因为要模拟的内部依赖项太多。在本文中,我将解释如何解决这些问题。 背景 如果您
WireMock 是一个灵活的库用于 Web 服务测试,和其他测试工具不同的是,WireMock 创建一个实际的 HTTP服务器来运行你的 Web 服务以方 便测试。 支持 HTTP 响应存根、请求验证、代理/拦截、记录和回放。 你可以去github上面下载最新版本的wiremock https://github.com/tomakehurst/wiremock 如果只要使用不用源码可以直接下载s
(一)Jar包下载与启动 1.这里使用了wiremock-standalone-2.19.0.jar 这个版本的依赖包,到相应的下载目录 2.直接用命令启动 java -jar wiremock-standalone-2.19.0.jar -port 9999 -verbose -verbose的意思是输出日志 启动之后会在当前目录下面生成两个文件夹,一个__files 另外一个 mappin
上一节课中给大家介绍了如何搭建 WireMock 服务并模拟了一个简单的 Get 请求接口。为了后续在学习接口测试过程中能模拟各种类型的接口,本次课程将带领大家学习如何通过 WireMock 模拟更复杂的接口,为了完成本次课程目标,我将课程内容拆分成了两个小的 Task: Task1:模拟 JSON 格式的接口 Task2:模拟 XML 格式接口 模拟 JSON 格式接口 模拟一个接口,总的来说就
参考地址 链接: link.