GithubHelp home page GithubHelp logo

lucasbode / mbdotnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattherman/mbdotnet

0.0 0.0 0.0 329 KB

A .NET client library for interacting with mountebank (www.mbtest.org).

License: MIT License

C# 99.84% Shell 0.04% Dockerfile 0.11%

mbdotnet's Introduction

MbDotNet

A .NET client library for interacting with mountebank (www.mbtest.org). This project aims to reduce the amount of mountebank knowledge required in order to create usable stubs.

A simple example:

var imposter = _client.CreateHttpImposter(4545, "My Imposter");
imposter.AddStub()
  .OnPathAndMethodEqual("/customers/123", Method.Get)
  .ReturnsXml(HttpStatusCode.OK, new Customer { Email = "[email protected]" });

The project currently targets .NET Standard 1.3, which is compatible with .NET Framework 4.6. If you need to use it in a project targeting an older framework version, such as .NET Framework 4.5, please use version 3.X.X of the package.

To get started, see Usage Examples (v4).

NuGet Package

The library is available for install as a NuGet package.

https://www.nuget.org/packages/MbDotNet

Unsupported Functionality

The following Mountebank functionality is not yet supported:

  • SMTP imposters
  • Stub behaviors
  • The "inject" response
  • The "exists" and "inject" predicates

Pull requests are always welcome.

Development

Prerequisites

The following items are necessary in order to build/test the project:

  • .NET Core SDK 2.0
  • .NET Core Runtime 2.0
  • Mountebank

Building

To build the project, run the following from the root directory:

dotnet build

Testing

To run all tests, run the following from the root directory:

dotnet test 

This includes a set of acceptance tests that run against an actual mountebank instance. In order for those tests to succeed, mountebank will need to be run with the --mock option provided. See http://www.mbtest.org/docs/api/overview#get-imposter.

If you would prefer to run mountebank via docker, please execute the following command from the root directory: docker-compose up

If you would like to just run the unit tests (which do not require mountebank), run the following:

dotnet test --filter TestCategory=Unit

Similarly, you can filter to only the acceptance tests using --filter TestCategory=Acceptance.

mbdotnet's People

Contributors

mattherman avatar nrjohnstone avatar superdrew avatar playaroundhub avatar mcosta91 avatar putnap avatar kiwiprog avatar lucasbode avatar ihramtsov avatar mabead avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.