public void AddressWithQuery()
        {
            const string address = @"http://regexlib.com/Search.aspx?k=web+address&c=-1&m=-1&ps=20";

            sut = WebAddress.Create(address);

            Assert.AreEqual(address, sut.ToString());
        }
        public void AddressWithoutWwwAndProtocol()
        {
            const string address = @"google.com";

            sut = WebAddress.Create(address);

            Assert.AreEqual(address, sut.ToString());
        }
        public void AddressWithPort()
        {
            const string address = @"http://localhost:49612/";

            sut = WebAddress.Create(address);

            Assert.AreEqual(address, sut.ToString());
        }
        public void AddressWithFolders()
        {
            const string address = @"http://www.affecto.com/bss/recruitment";

            sut = WebAddress.Create(address);

            Assert.AreEqual(address, sut.ToString());
        }
        public void AddressWithFinnishAlphabetExtraCharacters()
        {
            const string address = @"http://www.häviö.fi";

            sut = WebAddress.Create(address);

            Assert.AreEqual(address, sut.ToString());
        }
Example #6
0
        public static bool TryCreate(string webAddress, out WebAddress result, out string failureReason)
        {
            var specification = new WebAddressSpecification();
            if (specification.IsSatisfiedBy(webAddress))
            {
                result = new WebAddress(webAddress);
                failureReason = string.Empty;
                return true;
            }

            result = null;
            failureReason = specification.GetReasonsForDissatisfactionSeparatedWithNewLine();
            return false;
        }
        public void HttpProtocolAddress()
        {
            const string address = @"http://www.google.com";

            sut = WebAddress.Create(address);

            Assert.AreEqual(address, sut.ToString());
        }
        public void HttpsProtocolAddress()
        {
            const string address = @"https://www.affecto.com/";

            sut = WebAddress.Create(address);

            Assert.AreEqual(address, sut.ToString());
        }
Example #9
0
 protected bool Equals(WebAddress other)
 {
     return webAddress.Equals(other.webAddress);
 }