mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
7b56ab15b4
* Run cargo fmt on the whole code base * Second run * Add CI check * Fix compilation * More unnecessary braces * Handle weights * Use --all * Use correct attributes... * Fix UI tests * AHHHHHHHHH * 🤦 * Docs * Fix compilation * 🤷 * Please stop * 🤦 x 2 * More * make rustfmt.toml consistent with polkadot Co-authored-by: André Silva <andrerfosilva@gmail.com>
21 lines
611 B
Rust
21 lines
611 B
Rust
use crate::{mock::*, Error};
|
|
use frame_support::{assert_noop, assert_ok};
|
|
|
|
#[test]
|
|
fn it_works_for_default_value() {
|
|
new_test_ext().execute_with(|| {
|
|
// Dispatch a signed extrinsic.
|
|
assert_ok!(TemplateModule::do_something(Origin::signed(1), 42));
|
|
// Read pallet storage and assert an expected result.
|
|
assert_eq!(TemplateModule::something(), Some(42));
|
|
});
|
|
}
|
|
|
|
#[test]
|
|
fn correct_error_for_none_value() {
|
|
new_test_ext().execute_with(|| {
|
|
// Ensure the expected error is thrown when no value is present.
|
|
assert_noop!(TemplateModule::cause_error(Origin::signed(1)), Error::<Test>::NoneValue);
|
|
});
|
|
}
|