CSharpTest.Net
FileName Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > FileStreamFactory Class : FileName Property

Glossary Item Box

The FileName that this factory produces streams for

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property FileName As String
C# 
public string FileName {get;}

Example

Library/Library.Test/TestStreamCache.cs

C#Copy Code
using(TempFile tempFile = new TempFile())
{
    FileStreamFactory factory = new FileStreamFactory(tempFile.TempPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 1024, FileOptions.Asynchronous);
    Assert.AreEqual(tempFile.TempPath, factory.FileName);
    using (FileStream s = (FileStream)factory.Create())
        Assert.IsTrue(s.CanRead && s.CanWrite && s.IsAsync);
}
VB.NETCopy Code
Using tempFile As New TempFile()
    Dim factory As New FileStreamFactory(tempFile.TempPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None, 1024, FileOptions.Asynchronous)
    Assert.AreEqual(tempFile.TempPath, factory.FileName)
    Using s As FileStream = DirectCast(factory.Create(), FileStream)
        Assert.IsTrue(s.CanRead AndAlso s.CanWrite AndAlso s.IsAsync)
    End Using
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys