MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_identity_json_roundtrip

Function test_identity_json_roundtrip

atomic-identity/src/identity.rs:773–787  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

771
772 #[test]
773 fn test_identity_json_roundtrip() {
774 let identity = Identity::builder("alice")
775 .email("alice@example.com")
776 .identity_type(IdentityType::User)
777 .description("Test identity")
778 .build()
779 .unwrap();
780
781 let json = serde_json::to_string(&identity).unwrap();
782 let recovered: Identity = serde_json::from_str(&json).unwrap();
783
784 assert_eq!(identity.id, recovered.id);
785 assert_eq!(identity.name, recovered.name);
786 assert_eq!(identity.email, recovered.email);
787 }
788}

Callers

nothing calls this directly

Calls 5

emailMethod · 0.80
unwrapMethod · 0.45
buildMethod · 0.45
descriptionMethod · 0.45
identity_typeMethod · 0.45

Tested by

no test coverage detected