public void IsNull_Passing_Valid_Value_Returns_False(string value)
        {
            var expected = false;

            var actual = Subdomain.Create(value);

            Assert.AreEqual(expected, actual.IsNull);
        }
        public void Equals_Passing_Valid_Values_Returns_True(string value)
        {
            var left  = Subdomain.Create(value);
            var right = Subdomain.Create(value);

            var isEqual = left.Equals(right);

            Assert.IsTrue(isEqual);
        }
        public void ToString_Passing_Valid_Values_Returns_Subdomain(string value)
        {
            var expected = value;
            var result   = Subdomain.Create(value);

            var actual = result.ToString();

            Assert.AreEqual(expected, actual);
        }
        public void Change_Passing_Valid_Values_Returns_Subdomain()
        {
            var expected = "app.hackerone.com";
            var actual   = Subdomain.Create("stage.hackerone.com");

            actual.Change(expected);

            Assert.AreEqual(expected, actual.Value);
        }
        public void OperatorNotEqual_Passing_Valid_Values_Returns_True(string value)
        {
            var left  = Subdomain.Create(value);
            var right = Subdomain.Create("carlos.fffff.ff");

            var isEqual = left != right;

            Assert.IsTrue(isEqual);
        }
        public void OperatorEqual_Passing_Valid_Distinct_Values_Returns_False(string value)
        {
            var left  = Subdomain.Create(value);
            var right = Subdomain.Create("carlpopoos.ffff.ff");

            var isEqual = left == right;

            Assert.IsFalse(isEqual);
        }
        public void Equals_Passing_Valid_Distinct_Values_Returns_False(string value)
        {
            var left  = Subdomain.Create(value);
            var right = Subdomain.Create("pepe.dasdsad.rr");

            var isEqual = left.Equals(right);

            Assert.IsFalse(isEqual);
        }
Exemplo n.º 8
0
        public void SubdomainConvert()
        {
            var value = "documents"; // Ej. documents.kitpymes.com

            var expectedEnum   = Subdomain.Create(value);
            var expectedString = value;

            var convert = EntityFrameworkConverter.ToSubdomain <Subdomain>();

            var actualEnum   = convert.ConvertFromProvider(expectedString);
            var actualString = convert.ConvertToProvider(expectedEnum);

            Assert.AreEqual(expectedEnum.ToString(), actualEnum.ToString());
            Assert.AreEqual(expectedString, actualString);
        }
 public void Create_Passing_InvalidOrNull_Value_Returns_ApplicationException(string?value)
 {
     Assert.ThrowsException <ApplicationException>(() => Subdomain.Create(value));
 }
        public void Create_Passing_Valid_Values_Returns_Subdomain(string value)
        {
            var actual = Subdomain.Create(value);

            Assert.AreEqual(value, actual.Value);
        }