mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
- Make DirectoryInfo work - Refactored FAT TestRunner in a similar way to the BCL one - Bugfix: Path.GetTempPath() did not returned a complete path - Added to VFS "naive" support to Get / Set file attributes (for now only Get is supported) - Added more debug logs
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System.IO;
|
|
using Cosmos.TestRunner;
|
|
using Cosmos.Debug.Kernel;
|
|
|
|
namespace Cosmos.Kernel.Tests.Fat.System.IO
|
|
{
|
|
class StreamWriterTest
|
|
{
|
|
/// <summary>
|
|
/// Tests System.IO.StreamWriter plugs.
|
|
/// </summary>
|
|
public static void Execute(Debugger mDebugger)
|
|
{
|
|
mDebugger.Send("START TEST: StreamWriter:");
|
|
mDebugger.Send("Create StreamWriter");
|
|
|
|
using (var xSW = new StreamWriter(@"0:\test.txt"))
|
|
{
|
|
if (xSW != null)
|
|
{
|
|
try
|
|
{
|
|
mDebugger.Send("Start writing");
|
|
|
|
xSW.Write("A line of text for testing\nSecond line");
|
|
}
|
|
catch
|
|
{
|
|
Assert.IsTrue(false, @"Couldn't write to file 0:\test.txt using StreamWriter");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Assert.IsTrue(false, @"Failed to create StreamWriter for file 0:\test.txt");
|
|
}
|
|
}
|
|
|
|
mDebugger.Send("END TEST");
|
|
}
|
|
}
|
|
}
|