mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-15 14:46:39 +01:00
30 lines
1 KiB
C#
30 lines
1 KiB
C#
using NUnit.Framework;
|
|
using ShareeBike.Model.User.Account;
|
|
|
|
|
|
namespace SharedBusinessLogic.Tests
|
|
{
|
|
|
|
[TestFixture]
|
|
public class TestValidator
|
|
{
|
|
[Test]
|
|
public void TestValidateMailAndPasswordDelegate()
|
|
{
|
|
Assert.That(Validator.ValidateMailAndPasswordDelegate(null, null).ValidElement, Is.EqualTo(Elements.None));
|
|
|
|
Assert.That(Validator.ValidateMailAndPasswordDelegate("", null).ValidElement, Is.EqualTo(Elements.None));
|
|
|
|
Assert.That(Validator.ValidateMailAndPasswordDelegate("a", null).ValidElement, Is.EqualTo(Elements.None));
|
|
|
|
Assert.That(Validator.ValidateMailAndPasswordDelegate("a@", null).ValidElement, Is.EqualTo(Elements.None));
|
|
|
|
|
|
Assert.That(Validator.ValidateMailAndPasswordDelegate("a@c", "").ValidElement, Is.EqualTo(Elements.Mail));
|
|
|
|
Assert.That(Validator.ValidateMailAndPasswordDelegate("a@c", "123").ValidElement, Is.EqualTo(Elements.Mail));
|
|
|
|
Assert.That(Validator.ValidateMailAndPasswordDelegate("a@c", "123456789" /* password */).ValidElement, Is.EqualTo(Elements.Mail | Elements.Password));
|
|
}
|
|
}
|
|
}
|