MCPcopy Create free account
hub / github.com/dfinity/orbit / valid_model_serialization

Function valid_model_serialization

core/control-panel/impl/src/models/user.rs:196–216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194
195 #[test]
196 fn valid_model_serialization() {
197 let model = mock_user();
198
199 let serialized_model = model.to_bytes();
200 let deserialized_model = User::from_bytes(serialized_model);
201
202 assert_eq!(model.identity, deserialized_model.identity);
203 assert_eq!(
204 model.subscription_status,
205 deserialized_model.subscription_status
206 );
207 assert_eq!(model.stations, deserialized_model.stations);
208 assert_eq!(
209 model.deployed_stations,
210 deserialized_model.deployed_stations
211 );
212 assert_eq!(
213 model.last_update_timestamp,
214 deserialized_model.last_update_timestamp
215 );
216 }
217
218 #[test]
219 fn check_stations_validation() {

Callers

nothing calls this directly

Calls 2

mock_userFunction · 0.70
to_bytesMethod · 0.45

Tested by

no test coverage detected