RegressionTests__Win32OperatingSystemTest.st
branchjv
changeset 2214 ba58ef8a6214
parent 2087 43b964e25f8a
child 2592 7aa9af5b0ddb
equal deleted inserted replaced
2096:aecb2604da9c 2214:ba58ef8a6214
  2503 
  2503 
  2504     "Created: / 16-11-2018 / 12:16:16 / svestkap"
  2504     "Created: / 16-11-2018 / 12:16:16 / svestkap"
  2505     "Modified (format): / 01-02-2019 / 13:32:02 / svestkap"
  2505     "Modified (format): / 01-02-2019 / 13:32:02 / svestkap"
  2506 ! !
  2506 ! !
  2507 
  2507 
       
  2508 !Win32OperatingSystemTest methodsFor:'tests-unicodeRename'!
       
  2509 
       
  2510 testRenameSubKey_01
       
  2511     "Testing if subKey is correctly renamed"
       
  2512     | readData testingRegistryEntryPath |   
       
  2513 
       
  2514     testingRegistryEntryPath := Win32OperatingSystem registryEntry key: registryPath.
       
  2515     
       
  2516     self assert: (testingRegistryEntryPath renameSubKey: ' ルすしか_testing_delete'  to: 'RenamedSubKey').
       
  2517     readData := testingRegistryEntryPath subKeyNamed: 'RenamedSubKey'.
       
  2518     
       
  2519     self assert: readData notEmptyOrNil.
       
  2520     self assert: readData path = (registryPath, '\', 'RenamedSubKey').
       
  2521 
       
  2522     "
       
  2523      self run:#testRenameSubKey_01
       
  2524      self new testRenameSubKey_01
       
  2525     "
       
  2526 
       
  2527     "Created: / 09-04-2019 / 09:05:28 / svestkap"
       
  2528 !
       
  2529 
       
  2530 testRenameSubKey_02
       
  2531     "Testing if subKey is correctly renamed"
       
  2532     | readData testingRegistryEntryPath |   
       
  2533 
       
  2534     testingRegistryEntryPath := Win32OperatingSystem registryEntry key: registryPath.
       
  2535     
       
  2536     self assert: (testingRegistryEntryPath renameSubKey: ' ルすしか_testing_delete'  to: 'すしか_').
       
  2537     readData := testingRegistryEntryPath subKeyNamed: 'すしか_'.
       
  2538     
       
  2539     self assert: readData notEmptyOrNil.
       
  2540     self assert: readData path = (registryPath, '\', 'すしか_').
       
  2541 
       
  2542     testingRegistryEntryPath := Win32OperatingSystem registryEntry key: (registryPath, '\', 'すしか_').
       
  2543     readData := testingRegistryEntryPath subKeyNamed: 'bobr'.
       
  2544     
       
  2545     self assert: readData notEmptyOrNil.
       
  2546     self assert: readData path = (registryPath, '\', 'すしか_', '\', 'bobr')
       
  2547     
       
  2548     "
       
  2549      self run:#testRenameSubKey_02
       
  2550      self new testRenameSubKey_02
       
  2551     "
       
  2552 
       
  2553     "Created: / 09-04-2019 / 09:35:05 / svestkap"
       
  2554 !
       
  2555 
       
  2556 testRenameSubKey_03
       
  2557     "Testing when renamed subKey does not exist"
       
  2558     | readData testingRegistryEntryPath |   
       
  2559 
       
  2560     testingRegistryEntryPath := Win32OperatingSystem registryEntry key: registryPath.
       
  2561     
       
  2562     self deny: (testingRegistryEntryPath renameSubKey: 'a key that does not exist'  to: 'すしか_').
       
  2563     readData := testingRegistryEntryPath subKeyNamed: 'すしか_'.
       
  2564     
       
  2565     self assert: readData isEmptyOrNil
       
  2566     
       
  2567     "
       
  2568      self run:#testRenameSubKey_03
       
  2569      self new testRenameSubKey_03
       
  2570     "
       
  2571 
       
  2572     "Created: / 09-04-2019 / 09:39:52 / svestkap"
       
  2573 ! !
       
  2574 
  2508 !Win32OperatingSystemTest methodsFor:'tests-unicodeWrite'!
  2575 !Win32OperatingSystemTest methodsFor:'tests-unicodeWrite'!
  2509 
  2576 
  2510 testDefaultValue_01
  2577 testDefaultValue_01
  2511     "Testing if value can be stored (defaultValue:) and read (defaultValue)
  2578     "Testing if value can be stored (defaultValue:) and read (defaultValue)
  2512      Note: the value is stored in (Default) value at the key"
  2579      Note: the value is stored in (Default) value at the key"