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)); } } }