public void FromStorageFolder_InheritableThrowsNotSupported()
        {
            IStorageFolder folder = new StorageFolderMock();

            Assert.Throws <NotSupportedException>(() => folder.CreateSafeFileHandle("Foo", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Inheritable));
        }
示例#2
0
        public void FromStorageFolder_BadAccessThrowsOutOfRange()
        {
            IStorageFolder folder = new StorageFolderMock();

            AssertExtensions.Throws <ArgumentOutOfRangeException>("access", () => folder.CreateSafeFileHandle("Foo", FileMode.OpenOrCreate, (FileAccess)100));
        }
        public void FromStorageFolder_BadOptionsThrowsOutOfRange()
        {
            IStorageFolder folder = new StorageFolderMock();

            Assert.Throws <ArgumentOutOfRangeException>("options", () => folder.CreateSafeFileHandle("Foo", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read, (FileOptions)100));
        }
示例#4
0
        public void FromStorageFolder_BadModeThrowsOutOfRange()
        {
            IStorageFolder folder = new StorageFolderMock();

            AssertExtensions.Throws <ArgumentOutOfRangeException>("mode", () => folder.CreateSafeFileHandle("Foo", (FileMode)100));
        }