public void SaveNoModifySystemWhenUserIsNotAdministrator() { var path = new EnvironmentVariablePathInMemory(@"C:\System\Path1;", @"C:\User\Path1;"); new MainWindowViewModel( path, new BackupFake(SaveBackupResult.Done), new UserFake(false) ).SaveCommand.Execute(new FormattedEnvironmentVariablePathFake(@"C:\System\Path2;", @"C:\User\Path2;")); Assert.Equal(@"C:\System\Path1;", path.System); Assert.Equal(@"C:\User\Path2;", path.User); }
public void Save(string formattedSystem, string formattedUser, string expectedSystem, string expectedUser) { var path = new EnvironmentVariablePathInMemory(); new MainWindowViewModel( path, new BackupFake(SaveBackupResult.Done), new UserFake(true) ).SaveCommand.Execute(new FormattedEnvironmentVariablePathFake(formattedSystem, formattedUser)); Assert.Equal(expectedSystem, path.System); Assert.Equal(expectedUser, path.User); }