Files
dotnet-runtime/src/libraries/System.IO.FileSystem/tests/FileStream/EndRead.cs
T
Jeremy Kuhne db81a86a72 Add negative tests for Begin/End
Adds negative tests for Begin/End, removes unnecessary block for `\\.\`
paths.

(The block for `\\.\` paths fulfills a need that predates our supported
Windows OSes. You cannot inadvertently mess up "raw" drives. In addition
we currently allow `\\?\` which is another form of device path access.)


Commit migrated from https://github.com/dotnet/corefx/commit/5376c25bea9523265696ed5806f3dc8b51bbbf25
2016-09-26 16:25:37 -07:00

23 lines
666 B
C#

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using Xunit;
namespace System.IO.Tests
{
public class FileStream_EndRead : FileSystemTest
{
[Fact]
public void EndReadThrowsForNullAsyncResult()
{
using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite))
{
Assert.Throws<ArgumentNullException>("asyncResult", () => fs.EndRead(null));
}
}
}
}