MCPcopy Create free account
hub / github.com/PowerShell/DSC / delete_tree

Function delete_tree

lib/dsc-lib-registry/src/lib.rs:515–529  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

513
514#[test]
515fn delete_tree() {
516 let reg_helper = RegistryHelper::new_from_json(r#"{"keyPath":"HKCU\\DSCTest2\\DSCSubKey","valueName":"TestValue","valueData": { "String": "Hello"} }"#).unwrap();
517 reg_helper.set().unwrap();
518 let result = reg_helper.get().unwrap();
519 assert_eq!(result.key_path, r#"HKCU\DSCTest2\DSCSubKey"#);
520 assert_eq!(result.value_name, Some("TestValue".to_string()));
521 assert_eq!(result.value_data, Some(RegistryValueData::String("Hello".to_string())));
522 let reg_helper = RegistryHelper::new_from_json(r#"{"keyPath":"HKCU\\DSCTest2"}"#).unwrap();
523 reg_helper.remove().unwrap();
524 let result = reg_helper.get().unwrap();
525 assert_eq!(result.key_path, r#"HKCU\DSCTest2"#);
526 assert_eq!(result.value_name, None);
527 assert_eq!(result.value_data, None);
528 assert_eq!(result.exist, Some(false));
529}

Callers

nothing calls this directly

Calls 3

removeMethod · 0.80
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected