feat: test Identity.User for resend_verification_email

This commit is contained in:
Aravinth Manivannan 2025-01-21 15:16:10 +05:30
parent 8b6f5f0acb
commit 53cd452946
Signed by: realaravinth
GPG key ID: F8F50389936984FF

View file

@ -412,4 +412,28 @@ mod tests {
.when(IdentityCommand::SetAdmin(cmd))
.then_expect_events(vec![expected]);
}
#[test]
fn test_user_aggregate_resend_verification_email() {
use crate::identity::application::services::resend_verification_email::{
command::*, service::*, *,
};
let cmd = ResendVerificationEmailCommand::get_cmd();
let expected = IdentityEvent::VerificationEmailResent;
let mut services = MockIdentityServicesInterface::new();
services
.expect_resend_verification_email()
.times(IS_CALLED_ONLY_ONCE.unwrap())
.return_const(ResendVerificationEmailService::mock_service(
IS_CALLED_ONLY_ONCE,
cmd.clone(),
));
UserTestFramework::with(Arc::new(services))
.given_no_previous_events()
.when(IdentityCommand::ResendVerificationEmail(cmd))
.then_expect_events(vec![expected]);
}
}