feat: test Identity.User for update_email
This commit is contained in:
parent
4c9b75b218
commit
6176daa83d
1 changed files with 25 additions and 0 deletions
|
@ -338,4 +338,29 @@ mod tests {
|
||||||
.when(IdentityCommand::UpdatePassword(cmd))
|
.when(IdentityCommand::UpdatePassword(cmd))
|
||||||
.then_expect_events(vec![expected]);
|
.then_expect_events(vec![expected]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_user_aggregate_update_email() {
|
||||||
|
use crate::identity::application::services::update_email::{
|
||||||
|
command::*, events::*, service::*, *,
|
||||||
|
};
|
||||||
|
|
||||||
|
let cmd = UpdateEmailCommand::get_cmd();
|
||||||
|
let expected = EmailUpdatedEvent::get_event(&cmd);
|
||||||
|
let expected = IdentityEvent::EmailUpdated(expected);
|
||||||
|
|
||||||
|
let mut services = MockIdentityServicesInterface::new();
|
||||||
|
services
|
||||||
|
.expect_update_email()
|
||||||
|
.times(IS_CALLED_ONLY_ONCE.unwrap())
|
||||||
|
.return_const(UpdateEmailService::mock_service(
|
||||||
|
IS_CALLED_ONLY_ONCE,
|
||||||
|
cmd.clone(),
|
||||||
|
));
|
||||||
|
|
||||||
|
UserTestFramework::with(Arc::new(services))
|
||||||
|
.given_no_previous_events()
|
||||||
|
.when(IdentityCommand::UpdateEmail(cmd))
|
||||||
|
.then_expect_events(vec![expected]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue