Exemple #1
0
        public void WhenPathIsRelative_ShouldReturnRelativeCurrentPath( )
        {
            var fixture = new Fixture( );
            var path    = fixture.Create("path-");
            var result  = LinuxPath.GetPathRoot(path);

            Assert.Equal("./", result);
        }
Exemple #2
0
        public void WhenPathIsRooted_ShouldReturnRootPath()
        {
            var fixture = new Fixture( );
            var path    = fixture.Create("/path-");
            var result  = LinuxPath.GetPathRoot(path);

            Assert.Equal("/", result);
        }
Exemple #3
0
        public void GetPathRootTest()
        {
            String result = LinuxPath.GetPathRoot("/system/busybox");

            Assert.AreEqual <string>("/", result);

            result = LinuxPath.GetPathRoot("/system/xbin/");
            Assert.AreEqual <string>("/", result);

            result = LinuxPath.GetPathRoot("/system/xbin/file.ext");
            Assert.AreEqual <string>("/", result);
        }
Exemple #4
0
        public void WhenPathEmpty_ShouldReturnRelativeCurrentPath( )
        {
            var result = LinuxPath.GetPathRoot(string.Empty);

            Assert.Equal("./", result);
        }
Exemple #5
0
        public void WhenPathIsNull_ShouldReturnNull()
        {
            var result = LinuxPath.GetPathRoot(null);

            Assert.Null(result);
        }