public async void TestAutoLogonUnConfigureForDifferentUser() { //strategy- //1. fill some existing values in the registry //2. run configure //3. make sure the old values are there in the backup //4. unconfigure //5. make sure original values are reverted back using (var hc = new TestHostContext(this)) { _domainName = "avengers"; SetupTestEnv(hc, _sidForDifferentUser); SetupRegistrySettings(_sidForDifferentUser); var iConfigManager = new AutoLogonManager(); iConfigManager.Initialize(hc); await iConfigManager.ConfigureAsync(_command); iConfigManager.Unconfigure(); //original values were reverted RegistryVerificationForUnConfigure(_sidForDifferentUser); } }
public async void TestAutoLogonUnConfigure() { //strategy- //1. fill some existing values in the registry //2. run configure //3. make sure the old values are there in the backup //4. unconfigure //5. make sure original values are reverted back using (var hc = new TestHostContext(this)) { SetupTestEnv(hc, _sid); SetupRegistrySettings(_sid); var iConfigManager = new AutoLogonManager(); iConfigManager.Initialize(hc); await iConfigManager.ConfigureAsync(_command); //make sure the backup was taken for the keys RegistryVerificationForBackup(_sid); // Debugger.Launch(); iConfigManager.Unconfigure(); //original values were reverted RegistryVerificationForUnConfigure(_sid); } }
public async void TestAutoLogonConfigurationForDifferentUser() { using (var hc = new TestHostContext(this)) { SetupTestEnv(hc, _sidForDifferentUser); var iConfigManager = new AutoLogonManager(); iConfigManager.Initialize(hc); await iConfigManager.ConfigureAsync(_command); VerifyRegistryChanges(_sidForDifferentUser); Assert.True(_powerCfgCalledForACOption); Assert.True(_powerCfgCalledForDCOption); } }
public async void TestAutoLogonConfiguration() { using (var hc = new TestHostContext(this)) { _domainName = "avengers"; _runOnce = ""; SetupTestEnv(hc, _sid); var iConfigManager = new AutoLogonManager(); iConfigManager.Initialize(hc); await iConfigManager.ConfigureAsync(_command); VerifyRegistryChanges(_sid); Assert.True(_powerCfgCalledForACOption); Assert.True(_powerCfgCalledForDCOption); } }
public async void TestAutoLogonConfigurationForDotAsDomainName() { using (var hc = new TestHostContext(this)) { // Set the domain name to '.' _domainName = "."; SetupTestEnv(hc, _sid); var iConfigManager = new AutoLogonManager(); iConfigManager.Initialize(hc); await iConfigManager.ConfigureAsync(_command); // Domain should have been set to Environment.Machine name in case the value passsed was '.' _domainName = Environment.MachineName; VerifyRegistryChanges(_sid); Assert.True(_powerCfgCalledForACOption); Assert.True(_powerCfgCalledForDCOption); } }
public async void TestAutoLogonRunOnce() { using (var hc = new TestHostContext(this)) { _domainName = "avengers"; _runOnce = "--once"; SetupTestEnv(hc, _sid); SetupRegistrySettings(_sid); var iConfigManager = new AutoLogonManager(); iConfigManager.Initialize(hc); await iConfigManager.ConfigureAsync(_command); VerifyRegistryChanges(_sid); iConfigManager.Unconfigure(); //original values were reverted RegistryVerificationForUnConfigure(_sid); } }