public void SetComputerName_NewName_RenamePendingIsTrue() { // Arrange Assert.IsFalse(_compNameBridge.IsRenamePending()); var originalNetBIOSName = new EasClientDeviceInformation().FriendlyName; // Make sure the current NetBIOS name does not equal the new test one // If it does, alter the postfix on it string desiredNewName = $"{NEW_COMPUTERNAME_PREFIX}-1"; if (String.Equals( originalNetBIOSName, desiredNewName, StringComparison.OrdinalIgnoreCase)) { desiredNewName = $"{NEW_COMPUTERNAME_PREFIX}-2"; } // Act _compNameBridge.SetName(desiredNewName); // Assert var isPending = _compNameBridge.IsRenamePending(); _compNameBridge.SetName(originalNetBIOSName); // Revert name change Assert.IsTrue(isPending); }
private async void RenameButton_Click(object sender, RoutedEventArgs e) { var name = NewComputerName.Text; await base.RunAPIInBackground(() => { _compNameBridge.SetName(name); }); }