Added UniqueId property to ICredential

This commit is contained in:
David Sparer
2016-10-28 11:11:11 -06:00
parent 22ca5b76b4
commit 6ed7568cd9
3 changed files with 14 additions and 2 deletions

View File

@@ -15,6 +15,13 @@ namespace mRemoteNGTests.Credential
_credentialRecord = new CredentialRecord();
}
[Test]
public void UuidIsUnique()
{
var credRecord2 = new CredentialRecord();
Assert.That(_credentialRecord.UniqueId, Is.Not.EqualTo(credRecord2.UniqueId));
}
[Test]
public void HasUsername()
{

View File

@@ -1,10 +1,13 @@
using System.Security;
using System;
using System.Security;
namespace mRemoteNG.Credential
{
public class CredentialRecord : ICredential
{
public Guid UniqueId { get; } = Guid.NewGuid();
public string Username { get; set; } = "";
public SecureString Password { get; set; } = new SecureString();

View File

@@ -1,10 +1,12 @@
using System.Security;
using System;
using System.Security;
namespace mRemoteNG.Credential
{
public interface ICredential
{
Guid UniqueId { get; }
string Username { get; set; }
SecureString Password { get; set; }
string Domain { get; set; }