コード例 #1
0
ファイル: UriTests.cs プロジェクト: stoneflyop1/NetGltf
        public void UriUtil_Normalize_Test()
        {
            var http = "http://test.com";

            Assert.Equal(http, UriUtil.Normalize(http));
            var https = "https://test.com";

            Assert.Equal(https, UriUtil.Normalize(https));
            var ftp = "ftp://test.com";

            Assert.Equal(ftp, UriUtil.Normalize(ftp));
            if (UriUtil.IsWin())
            {
                var windowsUrl = @"c:\1\2"; //@"c:\folder\myfile.txt";
                var nUrl       = UriUtil.Normalize(windowsUrl);
                Assert.Equal("file:///c:/1/2", nUrl);
            }
            else
            {
                var unixUrl = "/1/2/";
                var nUrl    = UriUtil.Normalize(unixUrl);
                Assert.Equal("file:///1/2", nUrl);
            }
        }