Exemple #1
0
        public void IsItCorrectResultOfRegex()
        {
            CheckWeb web    = new CheckWeb();
            string   actual = web.CreateRightAddress("vk", "ru");

            StringAssert.Matches(actual, new Regex(@"^http(s)?://([\w-]+.)+[\w-]+(/[\w- ./?%&=])?$"));
        }
Exemple #2
0
        public void IsItStartRight()
        {
            CheckWeb web    = new CheckWeb();
            string   actual = web.CreateRightAddress("vk", "ru");

            StringAssert.StartsWith(actual, "http");
        }
Exemple #3
0
        public void IsItContainAddress()
        {
            CheckWeb web    = new CheckWeb();
            string   actual = web.CreateRightAddress("vk", "ru");

            StringAssert.Contains(actual, "http://");
        }
Exemple #4
0
        public void IsItMinNotNull()
        {
            CheckWeb web    = new CheckWeb();
            var      actual = web.Min(2, 4, 7);

            Console.WriteLine(actual);
            Assert.IsNotNull(actual);
        }
Exemple #5
0
        public void Check_ReturnRightAddress()
        {
            string str      = "http:/google.com";
            bool   expected = false;

            CheckWeb check = new CheckWeb();

            check.Check(str);
        }
Exemple #6
0
        public void IsItMinOrNull()
        {
            CheckWeb web = new CheckWeb();
            //var actual = web.Min(2,4,7);
            string actual = null;

            Console.WriteLine(actual);
            Assert.IsNull(actual);
        }
Exemple #7
0
        public void CreateRightAddress()
        {
            CheckWeb web        = new CheckWeb();
            bool     trexpect   = true;
            bool     flexpect   = false;
            string   actual     = web.CreateRightAddress("vk", "ru");
            bool     actualBool = web.Check(actual);

            Assert.AreEqual(trexpect, actualBool);
        }
Exemple #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         labhost.Text = GetWebUrl();
         if (CheckWeb.Check())
         {
             Response.Redirect("http://" + HttpContext.Current.Request.Url.Host.ToString());
         }
     }
 }
Exemple #9
0
        public void AddressReturnTrue()
        {
            string   str      = "http://google.com";
            bool     trexpect = true;
            bool     flexpect = false;
            CheckWeb web      = new CheckWeb();

            bool actual = web.Check(str);

            Assert.AreEqual(trexpect, actual);
        }