MDAT 1.0.0-rc6
See the version list below for details.
dotnet add package MDAT --version 1.0.0-rc6
NuGet\Install-Package MDAT -Version 1.0.0-rc6
<PackageReference Include="MDAT" Version="1.0.0-rc6" />
paket add MDAT --version 1.0.0-rc6
#r "nuget: MDAT, 1.0.0-rc6"
// Install MDAT as a Cake Addin #addin nuget:?package=MDAT&version=1.0.0-rc6&prerelease // Install MDAT as a Cake Tool #tool nuget:?package=MDAT&version=1.0.0-rc6&prerelease
mdAT - Markdown Auto-Tests
mdAT
is a simple library that replaces unit and integration tests. With mdAT
, developers can write unit tests in the traditional way, but without the need to add many test data from JSON, XML, YAML files, or use manual [InlideData]
with escaped JSON object.
To use mdAT
, follow these steps:
- Create a normal MSTestV2 with
[TestClass]
,[TestMethod]
. - Code your unit test in the traditional way using
Moq
, if needed, then call your method you want to test. - Add all your desired parameters to your test method, theses will be exposed to be replaced by
mdAT
markdown test file. - Add
[MarkdownTest("~/Tests/{method}.md")]
with yourTests
folder as cases repository (let it being empty in first place). - Ensure to surround your tested method with
Verify.Assert()
, it will automatically validate the JSON expected result, even if it is an exception. - Your
.md
test file will be autogenerated during the first run. - Edit your
.md
file as you wish. - Enjoy!
[TestClass]
public class Calc
{
[TestMethod]
[MarkdownTest("~/Tests/{method}.md")]
public async Task Add(int val1, int val2, string expected)
{
_ = await Verify.Assert(() => Task.FromResult(Add(val1, val2)), expected);
}
// Fake usecase
public static int Add(int val1, int val2)
{
return val1 + val2;
}
}
All test cases can be stored in a single markdown file:
# Test Add method
Simple test case for addition tests.
## Case 1
Let's try simple `1 + 1` expected to return `2`
``````yaml
val1: 1
val2: 1
expected: 2
``````
## Case 2
``````yaml
val1: 212
val2: 2444
expected: 2656
``````
Using mdAT
, analysts and developers can work together with a unique source of tests, and maintainers can edit and validate all tests locally or on a build server.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- LoxSmoke.DocXml (>= 3.5.0)
- Markdig (>= 0.31.0)
- MSTest.TestFramework (>= 3.0.2)
- Newtonsoft.Json (>= 13.0.3)
- Quibble.Xunit (>= 0.2.51)
- YamlDotNet (>= 13.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.1 | 454 | 4/20/2024 |
1.3.0 | 116 | 4/20/2024 |
1.2.4 | 202 | 9/28/2023 |
1.2.3 | 132 | 9/28/2023 |
1.2.2 | 157 | 9/23/2023 |
1.2.1 | 151 | 9/8/2023 |
1.2.0 | 199 | 6/15/2023 |
1.1.6 | 183 | 5/29/2023 |
1.1.5 | 169 | 5/19/2023 |
1.1.4 | 163 | 5/11/2023 |
1.1.3 | 180 | 5/11/2023 |
1.1.2 | 193 | 5/5/2023 |
1.1.1 | 201 | 4/25/2023 |
1.1.0 | 188 | 4/25/2023 |
1.0.0 | 205 | 4/21/2023 |
1.0.0-rc7 | 151 | 4/21/2023 |
1.0.0-rc6 | 141 | 4/20/2023 |
1.0.0-rc4 | 128 | 4/20/2023 |
1.0.0-rc3 | 142 | 4/20/2023 |
1.0.0-rc2 | 145 | 4/19/2023 |
1.0.0-rc1 | 141 | 4/16/2023 |
1.0.0-beta7 | 150 | 4/14/2023 |
1.0.0-beta6 | 149 | 4/14/2023 |
1.0.0-beta5 | 146 | 4/14/2023 |
1.0.0-beta4 | 146 | 4/5/2023 |
1.0.0-beta3 | 138 | 4/5/2023 |
1.0.0-beta2 | 144 | 4/3/2023 |
1.0.0-beta1 | 124 | 4/3/2023 |