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

Function test_identity_json_roundtrip

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

Source from the content-addressed store, hash-verified

739
740 #[test]
741 fn test_identity_json_roundtrip() {
742 let identity = Identity::builder("alice")
743 .email("alice@example.com")
744 .identity_type(IdentityType::User)
745 .description("Test identity")
746 .build()
747 .unwrap();
748
749 let json = serde_json::to_string(&identity).unwrap();
750 let recovered: Identity = serde_json::from_str(&json).unwrap();
751
752 assert_eq!(identity.id, recovered.id);
753 assert_eq!(identity.name, recovered.name);
754 assert_eq!(identity.email, recovered.email);
755 }
756}

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