mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
35 lines
931 B
C#
35 lines
931 B
C#
using mRemoteNG.Security;
|
|
using mRemoteNGTests.NUnitExtensions;
|
|
using NUnit.Framework;
|
|
|
|
namespace mRemoteNGTests.UI.Controls
|
|
{
|
|
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 = new SecureTextBoxTester(_testForm.secureTextBox1.Name);
|
|
const string textToSend = "abc123";
|
|
textBox.Properties.Text = textToSend;
|
|
Assert.That(textBox.Properties.SecString.ConvertToUnsecureString(), Is.EqualTo(textToSend));
|
|
}
|
|
}
|
|
} |