- ActivityEnv ( ActivitySource ActivitySource, Activity? Activity, string? ParentId)
- MemoryConsole
- MemoryConsole ()
- WriteKey (ConsoleKeyInfo key)
- WriteKeyChar (char ch)
- WriteKeyString (string str)
- WriteKeyLine (string str)
- Commit ()
- GetEnumerator ()
- MemorySystemEnvironment
- MemorySystemEnvironment ( ConcurrentDictionary<string, Option<string>> processEnvironmentVariables, ConcurrentDictionary<string, Option<string>> userEnvironmentVariables, ConcurrentDictionary<string, Option<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, long tickCount, string userDomainName, bool userInteractive, string userName, Version version, long workingSet, Func<Environment.SpecialFolder, 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, Option<string>>? ProcessEnvironmentVariables = null, ConcurrentDictionary<string, Option<string>>? UserEnvironmentVariables = null, ConcurrentDictionary<string, Option<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, long? TickCount = null, string? UserDomainName = null, bool? UserInteractive = null, string? UserName = null, Version? Version = null, long? WorkingSet = null, Func<Environment.SpecialFolder, Environment.SpecialFolderOption, string>? GetFolderPath = null)
- InitFromSystem ()
Sub modules
Live |
Sys |
Test |
Traits |
record ActivityEnv ( ActivitySource ActivitySource, Activity? Activity, string? ParentId) Source #
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 #
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, Option<string>> ProcessEnvironmentVariables Source #
field ConcurrentDictionary<string, Option<string>> UserEnvironmentVariables Source #
field ConcurrentDictionary<string, Option<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<Environment.SpecialFolder, Environment.SpecialFolderOption, string> GetFolderPath Source #
constructor MemorySystemEnvironment ( ConcurrentDictionary<string, Option<string>> processEnvironmentVariables, ConcurrentDictionary<string, Option<string>> userEnvironmentVariables, ConcurrentDictionary<string, Option<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, long tickCount, string userDomainName, bool userInteractive, string userName, Version version, long workingSet, Func<Environment.SpecialFolder, Environment.SpecialFolderOption, string> getFolderPath) Source #
method MemorySystemEnvironment With ( ConcurrentDictionary<string, Option<string>>? ProcessEnvironmentVariables = null, ConcurrentDictionary<string, Option<string>>? UserEnvironmentVariables = null, ConcurrentDictionary<string, Option<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, long? TickCount = null, string? UserDomainName = null, bool? UserInteractive = null, string? UserName = null, Version? Version = null, long? WorkingSet = null, Func<Environment.SpecialFolder, Environment.SpecialFolderOption, string>? GetFolderPath = null) Source #
method MemorySystemEnvironment InitFromSystem () Source #