test/EasyFrameWork.Test/UrlHelperTest.cs

(完整代码) 1KB

using Easy;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Text;

namespace EasyFrameWork.Test
{
    [TestClass]
    public class UrlHelperTest
    {
        [TestMethod]
        public void TestCombine()
        {
            Assert.IsTrue(Helper.Url.Combine("home", "index") == "~/home/index");
        }
        [TestMethod]
        public void TestContainsScheme()
        {
            Assert.IsTrue(Helper.Url.ContainsScheme("http://www.zkea.net"));
            Assert.IsTrue(Helper.Url.ContainsScheme("https://www.zkea.net"));
            Assert.IsTrue(Helper.Url.ContainsScheme("ftp://www.zkea.net"));
            Assert.IsTrue(Helper.Url.ContainsScheme("file://www.zkea.net"));
        }
        [TestMethod]
        public void TestToVirtualPath()
        {
            Assert.IsTrue(Helper.Url.ToVirtualPath("home/index") == "~/home/index");
            Assert.IsTrue(Helper.Url.ToVirtualPath("/home/index") == "~/home/index");
            Assert.IsTrue(Helper.Url.ToVirtualPath("~/home/index") == "~/home/index");
        }
        [TestMethod]
        public void TestToAbsolutePath()
        {
            Assert.IsTrue(Helper.Url.ToAbsolutePath("home/index") == "/home/index");
            Assert.IsTrue(Helper.Url.ToAbsolutePath("/home/index") == "/home/index");
            Assert.IsTrue(Helper.Url.ToAbsolutePath("~/home/index") == "/home/index");
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。