- MemoryConsole
- MemoryConsole ()
- WriteKey (ConsoleKeyInfo key)
- WriteKeyChar (char ch)
- WriteKeyString (string str)
- WriteKeyLine (string str)
- Commit ()
- GetEnumerator ()
- MemoryFS
- MemorySystemEnvironment
- MemorySystemEnvironment ( ConcurrentDictionary<string, string> processEnvironmentVariables, ConcurrentDictionary<string, string> userEnvironmentVariables, ConcurrentDictionary<string, string> systemEnvironmentVariables, int exitCode, string commandLine, int currentManagedThreadId, Seq<string> commandLineArgs, Seq<string> logicalDrives, string newLine, bool hasShutdownStarted, bool is64BitOperatingSystem, bool is64BitProcess, string machineName, OperatingSystem osVersion, int processorCount, string stackTrace, string systemDirectory, int systemPageSize, int tickCount, string userDomainName, bool userInteractive, string userName, Version version, long workingSet, Func<System.Environment.SpecialFolder, System.Environment.SpecialFolderOption, string> getFolderPath)
- ProcessEnvironmentVariables
- UserEnvironmentVariables
- SystemEnvironmentVariables
- ExitCode
- HasShutdownStarted
- CommandLine
- CurrentManagedThreadId
- CommandLineArgs
- LogicalDrives
- NewLine
- Is64BitOperatingSystem
- Is64BitProcess
- MachineName
- OSVersion
- ProcessorCount
- StackTrace
- SystemDirectory
- SystemPageSize
- TickCount
- UserDomainName
- UserInteractive
- UserName
- Version
- WorkingSet
- GetFolderPath
- With ( ConcurrentDictionary<string, string>? ProcessEnvironmentVariables = null, ConcurrentDictionary<string, string>? UserEnvironmentVariables = null, ConcurrentDictionary<string, string>? SystemEnvironmentVariables = null, int? ExitCode = null, string? CommandLine = null, int? CurrentManagedThreadId = null, Seq<string>? CommandLineArgs = null, Seq<string>? LogicalDrives = null, string? NewLine = null, bool? HasShutdownStarted = null, bool? Is64BitOperatingSystem = null, bool? Is64BitProcess = null, string? MachineName = null, OperatingSystem? OSVersion = null, int? ProcessorCount = null, string? StackTrace = null, string? SystemDirectory = null, int? SystemPageSize = null, int? TickCount = null, string? UserDomainName = null, bool? UserInteractive = null, string? UserName = null, Version? Version = null, long? WorkingSet = null, Func<System.Environment.SpecialFolder, System.Environment.SpecialFolderOption, string>? GetFolderPath = null)
- InitFromSystem ()
Sub modules
Live |
Sys |
Test |
Traits |
class MemoryConsole Source #
An in-memory console emulation
Mostly for use in test runtimes. This simulates the real System.IO.Console, with additional functionality for pre-building a keyboard buffer (WriteKey, WriteKeyChar, WriteKeyString) and committing them as though they were typed. ReadKey and the other Read* methods will read the entries from the pre-built keyboard buffer.
There is no public API for this, other than the prepping of the keyboard buffer, which is outside of the normal console system.
constructor MemoryConsole () Source #
method Unit WriteKey (ConsoleKeyInfo key) Source #
Write a key into the keyboard buffer
Won't show in the console until Commit or Read* is called
method Unit WriteKeyChar (char ch) Source #
Write a character into the keyboard buffer
Won't show in the console until Commit or Read* is called
method Unit WriteKeyString (string str) Source #
Write a character into the keyboard buffer
No newline character is written Won't show in the console until Commit or Read* is called
method Unit WriteKeyLine (string str) Source #
Write a series of characters into the keyboard buffer followed by a newline
Won't show in the console until Commit or Read* is called
method Unit Commit () Source #
Commit what's in the keyboard buffer (as though they've been typed in)
returns |
method IEnumerator<string> GetEnumerator () Source #
Encapsulated in-memory file-system No public API exists for this other than for adding and getting the logical in-memory drives
Primarily used for testing (for use with Sys.Test.Runtime or your own runtimes)
This isn't anywhere near as strict as the real file-system, and so it shouldn't really be used to test file-operations. It should be used to test simple access to files without having to create them for real, or worry about what drives exist. Error messages shouldn't be relied on, only success and failure.
field string CurrentDir = "C:\\" Source #
method Seq<string> GetLogicalDrives () Source #
Get the logical in-memory drives
returns | Sequence of drive names |
method Unit AddLogicalDrive (string name) Source #
Add a logical in-memory drive
class MemorySystemEnvironment Source #
In-memory representation of the System.Environment
Use: MemorySystemEnvironment.InitFromSystem(), to initialise from the real System.Environment and then tweak for use in unit-tests using the With(...) method.
field ConcurrentDictionary<string, string> ProcessEnvironmentVariables Source #
field ConcurrentDictionary<string, string> UserEnvironmentVariables Source #
field ConcurrentDictionary<string, string> SystemEnvironmentVariables Source #
field bool HasShutdownStarted Source #
field string CommandLine Source #
field int CurrentManagedThreadId Source #
field Seq<string> CommandLineArgs Source #
field Seq<string> LogicalDrives Source #
field bool Is64BitOperatingSystem Source #
field bool Is64BitProcess Source #
field string MachineName Source #
field int ProcessorCount Source #
field string StackTrace Source #
field string SystemDirectory Source #
field int SystemPageSize Source #
field string UserDomainName Source #
field bool UserInteractive Source #
field long WorkingSet Source #
field Func<System.Environment.SpecialFolder, System.Environment.SpecialFolderOption, string> GetFolderPath Source #
constructor MemorySystemEnvironment ( ConcurrentDictionary<string, string> processEnvironmentVariables, ConcurrentDictionary<string, string> userEnvironmentVariables, ConcurrentDictionary<string, string> systemEnvironmentVariables, int exitCode, string commandLine, int currentManagedThreadId, Seq<string> commandLineArgs, Seq<string> logicalDrives, string newLine, bool hasShutdownStarted, bool is64BitOperatingSystem, bool is64BitProcess, string machineName, OperatingSystem osVersion, int processorCount, string stackTrace, string systemDirectory, int systemPageSize, int tickCount, string userDomainName, bool userInteractive, string userName, Version version, long workingSet, Func<System.Environment.SpecialFolder, System.Environment.SpecialFolderOption, string> getFolderPath) Source #
method MemorySystemEnvironment With ( ConcurrentDictionary<string, string>? ProcessEnvironmentVariables = null, ConcurrentDictionary<string, string>? UserEnvironmentVariables = null, ConcurrentDictionary<string, string>? SystemEnvironmentVariables = null, int? ExitCode = null, string? CommandLine = null, int? CurrentManagedThreadId = null, Seq<string>? CommandLineArgs = null, Seq<string>? LogicalDrives = null, string? NewLine = null, bool? HasShutdownStarted = null, bool? Is64BitOperatingSystem = null, bool? Is64BitProcess = null, string? MachineName = null, OperatingSystem? OSVersion = null, int? ProcessorCount = null, string? StackTrace = null, string? SystemDirectory = null, int? SystemPageSize = null, int? TickCount = null, string? UserDomainName = null, bool? UserInteractive = null, string? UserName = null, Version? Version = null, long? WorkingSet = null, Func<System.Environment.SpecialFolder, System.Environment.SpecialFolderOption, string>? GetFolderPath = null) Source #
method MemorySystemEnvironment InitFromSystem () Source #