mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
36 lines
901 B
C#
36 lines
901 B
C#
using System.Threading;
|
|
using mRemoteNG.Security;
|
|
using NUnit.Framework;
|
|
|
|
namespace mRemoteNGTests.UI.Controls
|
|
{
|
|
[Apartment(ApartmentState.STA)]
|
|
public class SecureTextBoxTests
|
|
{
|
|
private SecureTextBoxTestForm _testForm;
|
|
|
|
[SetUp]
|
|
public void Setup()
|
|
{
|
|
_testForm = new SecureTextBoxTestForm();
|
|
_testForm.Show();
|
|
}
|
|
|
|
[TearDown]
|
|
public void TearDown()
|
|
{
|
|
_testForm.Close();
|
|
while (_testForm.Disposing) { }
|
|
_testForm = null;
|
|
}
|
|
|
|
[Test]
|
|
public void TextboxInputGetsAddedToSecureString()
|
|
{
|
|
var textBox = _testForm.secureTextBox1;
|
|
const string textToSend = "abc123";
|
|
textBox.Text = textToSend;
|
|
Assert.That(textBox.SecString.ConvertToUnsecureString(), Is.EqualTo(textToSend));
|
|
}
|
|
}
|
|
} |