feat: test Identity.User for owner_remove_employee_from_store
This commit is contained in:
parent
5b852cc956
commit
382c0cf370
1 changed files with 28 additions and 1 deletions
|
@ -227,7 +227,11 @@ mod tests {
|
||||||
},
|
},
|
||||||
IdentityCommand, MockIdentityServicesInterface,
|
IdentityCommand, MockIdentityServicesInterface,
|
||||||
},
|
},
|
||||||
domain::{owner_add_employee_to_store_command::*, owner_added_employee_to_store_event::*},
|
domain::{
|
||||||
|
owner_add_employee_to_store_command::*, owner_added_employee_to_store_event::*,
|
||||||
|
owner_remove_employee_from_store_command::OwnerRemoveEmployeeFromStoreCommand,
|
||||||
|
owner_removed_employee_from_store_event::OwnerRemovedEmployeeFromStoreEvent,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use crate::tests::bdd::*;
|
use crate::tests::bdd::*;
|
||||||
|
|
||||||
|
@ -314,6 +318,29 @@ mod tests {
|
||||||
.then_expect_events(vec![expected]);
|
.then_expect_events(vec![expected]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_user_aggregate_owner_remove_employee_to_store() {
|
||||||
|
let cmd = OwnerRemoveEmployeeFromStoreCommand::get_cmd();
|
||||||
|
let expected = OwnerRemovedEmployeeFromStoreEvent::get_event(&cmd);
|
||||||
|
let expected = IdentityEvent::OwnerRemovedEmployeeFromStore(expected);
|
||||||
|
|
||||||
|
let mut services = MockIdentityServicesInterface::new();
|
||||||
|
services
|
||||||
|
.expect_owner_manage_employee()
|
||||||
|
.times(IS_CALLED_ONLY_ONCE.unwrap())
|
||||||
|
.return_const(
|
||||||
|
OwnerManageStoreEmployeesService::mock_service_remove_employee_from_store(
|
||||||
|
IS_CALLED_ONLY_ONCE,
|
||||||
|
cmd.clone(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
UserTestFramework::with(Arc::new(services))
|
||||||
|
.given_no_previous_events()
|
||||||
|
.when(IdentityCommand::OwnerRemoveEmployeeFromStore(cmd))
|
||||||
|
.then_expect_events(vec![expected]);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_user_aggregate_update_password() {
|
fn test_user_aggregate_update_password() {
|
||||||
use crate::identity::application::services::update_password::{
|
use crate::identity::application::services::update_password::{
|
||||||
|
|
Loading…
Add table
Reference in a new issue