Example #1
0
        public void StringWrapper_CanBeUsedWhenAStringIsCalledFor()
        {
            var s             = "*****@*****.**";
            var wrappedString = new EmailAddressExample(s);

            Assert.IsTrue(DidIGetAString(wrappedString));
        }
Example #2
0
        public void StringWrapper_ShouldBeEqualToCorrespondingPrimitive()
        {
            var s             = "*****@*****.**";
            var wrappedString = new EmailAddressExample(s);

            Assert.IsTrue(wrappedString == s);
            Assert.IsTrue(wrappedString.Value.Equals(s));
        }
Example #3
0
        public void StringWrapper_CustomValidationIsCalledOnInstantiation()
        {
            try
            {
                var s = new EmailAddressExample("Foo");
            }
            catch (Exception e)
            {
                Assert.IsNotNull(e);
                throw;
            }

            try
            {
                var s = new EmailAddressExample("@");
            }
            catch (Exception)
            {
                Assert.Fail();
            }
        }