All Projects → afshinm → morq

afshinm / morq

Licence: MIT license
BDD/TDD assertion interface

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to morq

utPLSQL-demo-project
Demo project using utPLSQL v3 with Travis as a CI server and SonarCloud for code analysis, coverage and test results
Stars: ✭ 24 (-70%)
Mutual labels:  unit-testing
dumbmutate
Simple mutation-testing
Stars: ✭ 32 (-60%)
Mutual labels:  unit-testing
Restaurants
Restaurants sample app built with the new architecture components (LiveData, Room, ViewModel) and Dagger 2
Stars: ✭ 47 (-41.25%)
Mutual labels:  unit-testing
bUnit
bUnit is a testing library for Blazor components that make tests look, feel, and runs like regular unit tests. bUnit makes it easy to render and control a component under test’s life-cycle, pass parameter and inject services into it, trigger event handlers, and verify the rendered markup from the component using a built-in semantic HTML comparer.
Stars: ✭ 857 (+971.25%)
Mutual labels:  unit-testing
jasmine-styleguide
Suggested best practices when writing Jasmine unit tests.
Stars: ✭ 65 (-18.75%)
Mutual labels:  unit-testing
MinimalApi
ASP.NET Core 7.0 - Minimal API Example - Todo API implementation using ASP.NET Core Minimal API, Entity Framework Core, Token authentication, Versioning, Unit Testing, Integration Testing and Open API.
Stars: ✭ 156 (+95%)
Mutual labels:  unit-testing
ttdo
Extend tinytest with diffobj
Stars: ✭ 21 (-73.75%)
Mutual labels:  unit-testing
helloworld
Boilerplate code for basic architecture of an android application following MVVM pattern using hilt, RxJava2.
Stars: ✭ 26 (-67.5%)
Mutual labels:  unit-testing
UTBotCpp
Tool that generates unit test by C/C++ source code, trying to reach all branches and maximize code coverage
Stars: ✭ 59 (-26.25%)
Mutual labels:  unit-testing
Tablier
A micro-framework for Table Driven Tests.
Stars: ✭ 33 (-58.75%)
Mutual labels:  unit-testing
unitizer
Easy R Unit Tests
Stars: ✭ 38 (-52.5%)
Mutual labels:  unit-testing
EntityFrameworkCore.AutoFixture
A library aimed to minimize the boilerplate required to unit-test Entity Framework Core code using AutoFixture and in-memory providers.
Stars: ✭ 31 (-61.25%)
Mutual labels:  unit-testing
chai-exclude
Exclude keys to compare from a deep equal operation with chai expect or assert.
Stars: ✭ 33 (-58.75%)
Mutual labels:  unit-testing
tau
A Micro (1k lines of code) Unit Test Framework for C/C++
Stars: ✭ 121 (+51.25%)
Mutual labels:  unit-testing
pythonista-chromeless
Serverless selenium which dynamically execute any given code.
Stars: ✭ 31 (-61.25%)
Mutual labels:  unit-testing
Guise
An elegant, flexible, type-safe dependency resolution framework for Swift
Stars: ✭ 53 (-33.75%)
Mutual labels:  unit-testing
Hexagonal-architecture-ASP.NET-Core
App generator API solution template which is built on Hexagnonal Architecture with all essential feature using .NET Core
Stars: ✭ 57 (-28.75%)
Mutual labels:  unit-testing
FRUITPy
Python interface for the FRUIT Fortran unit testing framework
Stars: ✭ 39 (-51.25%)
Mutual labels:  unit-testing
the-art-of-unit-testing
Repository that contains code in Node.js from the book The Art of Unit Testing, Second Edition by Roy Osherove
Stars: ✭ 22 (-72.5%)
Mutual labels:  unit-testing
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! 🍕
Stars: ✭ 409 (+411.25%)
Mutual labels:  unit-testing

morq Build Status

Write unit tests like humans

Install

cargo install morq

Morq Crate: https://crates.io/crates/morq

Grammar

Since we are using a macro here, you need to wrap the following rules in morq! macro.

Example:

morq!(
  expect(3).to.be.an(i32);
);

Chains

You use following chains to make the assertions more user friendly and readable.

  • to
  • be
  • have

Equal

expect(30).to.be.equal(10 * 3);
expect(3).to.be.equal(1 + 2);

Close

To compare two given float values

expect(3f32).to.be.close(3.0001f32);
expect(3f32).to.be.close_to(3.0001f32);

Not

Negates the chain.

expect(30).to.not.be.equal(10);
expect(3).to.not.be.equal(1);
expect(vec![1, 2, 3]).to.not.be.a(Vec<char>);

A / An

To check the data type.

expect(30).to.be.an(i32);
expect("hola".to_string()).to.not.be.a(f32);
expect(vec![1, 2, 3]).to.be.a(Vec<i32>);

Empty

To check and see if the iterator is empty or not

expect(vec![1, 2, 3]).to.not.be.empty();
expect(0..2).to.not.be.empty();

LengthOf

To check the count of elements in an iterator

expect(vec![1, 2, 3]).to.not.have.length_of(1usize);
expect(0..3).to.have.length_of(3usize);

Contain

Given iterator must contain the element

expect(vec![1, 2, 3]).to.contain(2);
expect(vec![false, false]).to.not.contain(true);

Ok / Err

To check a Result enum

let res: Result<String, String> = Ok(format!("boo"));

morq!(
    expect(res).to.be.ok();
);
let res: Result<String, String> = Err(format!("boo"));

morq!(
    expect(res).to.be.err();
);

Of course, you can combine it with not:

let res: Result<String, String> = Err(format!("boo"));

morq!(
    expect(res).to.not.be.ok();
);

Roadmap

  • Adding more chain rules

  • Adding more assert (terminal)

  • Ability to add two or more asserts in one chain:

    expect("hello").to.be.equal("hello").and.not.be.a(i32);

FAQ

morq?

Means chicken in Farsi. Like a lazy chicken, you know.

Artwork: clipart-library.com

Author

Afshin Mehrabani

License

MIT

Inspired by http://chaijs.com and https://github.com/carllerche/hamcrest-rust

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].