Beispiel #1
0
        public void FileStreamSelectCorrectStreamForASCIIPath()
        {
            var path = Path.Combine(PathToImages, "baboon.jpg");

            using (var stream = SKFileStream.OpenStream(path))
            {
                Assert.IsType <SKFileStream>(stream);
            }
        }
Beispiel #2
0
        public void FileStreamSelectCorrectStreamForNonASCIIPath()
        {
            var path = Path.Combine(PathToImages, "上田雅美.jpg");

            using (var stream = SKFileStream.OpenStream(path))
            {
                Assert.IsType <SKFileStream>(stream);
                Assert.True(((SKFileStream)stream).IsValid);
            }
        }
Beispiel #3
0
        public void FileStreamForMissingFile()
        {
            var path = Path.Combine(PathToImages, "missing-image.png");

            Assert.Null(SKFileStream.OpenStream(path));

            var stream = new SKFileStream(path);

            Assert.Equal(0, stream.Length);
            Assert.False(stream.IsValid);
        }
Beispiel #4
0
        public void FileStreamSelectCorrectStreamForNonASCIIPath()
        {
            var path = Path.Combine(PathToImages, "上田雅美.jpg");

            using (var stream = SKFileStream.OpenStream(path))
            {
                if (IsWindows)
                {
                    Assert.IsType <SKManagedStream>(stream);
                }
                else
                {
                    Assert.IsType <SKFileStream>(stream);
                }
            }
        }