mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
d53444ef81
* Rename Origin
* more renaming
* fixes
* fix errors
* last fix?
* rename
* Update mock.rs
* update lockfile for {"polkadot", "substrate"}
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
24 lines
635 B
Rust
24 lines
635 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(RuntimeOrigin::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(RuntimeOrigin::signed(1)),
|
|
Error::<Test>::NoneValue
|
|
);
|
|
});
|
|
}
|