LanguageExt.Sys

LanguageExt.Sys

Contents

Sub modules

Live
Sys
Test
Traits

record ActivityEnv ( ActivitySource ActivitySource, Activity? Activity, string? ParentId) Source #

Fields

field ActivityEnv Default Source #

Methods

method void Dispose () Source #

method string ToString () 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.

Constructors

constructor MemoryConsole () Source #

Methods

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)

Parameters

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.

Fields

field ConcurrentDictionary<string, Option<string>> ProcessEnvironmentVariables Source #

field ConcurrentDictionary<string, Option<string>> UserEnvironmentVariables Source #

field ConcurrentDictionary<string, Option<string>> SystemEnvironmentVariables Source #

field int ExitCode Source #

field string CommandLine Source #

field Seq<string> CommandLineArgs Source #

field Seq<string> LogicalDrives Source #

field string NewLine Source #

field bool Is64BitProcess Source #

field string MachineName Source #

field OperatingSystem OSVersion Source #

field string StackTrace Source #

field string SystemDirectory Source #

field long TickCount Source #

field string UserDomainName Source #

field string UserName Source #

field Version Version Source #

field long WorkingSet Source #

field Func<Environment.SpecialFolder, Environment.SpecialFolderOption, string> GetFolderPath Source #

Constructors

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 #

Methods

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 #