hdk_unit_testing 0.1.4

Functions to help make mocking HDK native functions easier. Not complete, this is a work in progress
Documentation
  • Coverage
  • 0%
    0 out of 13 items documented0 out of 11 items with examples
  • Size
  • Source code size: 58.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.45 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 16s Average build duration of successful builds.
  • all releases: 1m 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Connoropolous weswalla

HDK Unit Testing

This crate provides a library of mocked hdk functions to help with unit testing your zome functions.

usage

In your tests, instantiate a mutable MockHdkT object and pass a mutable reference of this into the mocked hdk functions.

let mut mock_hdk = MockHdkT::new();
let mock_hdk_ref = &mut mock_hdk;

All mocked functions take mock_hdk_ref as an input as well as the expected input and output of the called hdk function.

use hdk_unit_testing::mock_hdk::*;

mock_create(
    mock_hdk_ref,
    expected_input,
    expected_output,
);

See an example usage in Acorn.