From 458aaf2a47fecb5488eb503d30eebd35e313e1d2 Mon Sep 17 00:00:00 2001 From: Julian Verdurmen <304NotModified@users.noreply.github.com> Date: Thu, 13 Jun 2019 02:33:50 +0200 Subject: [PATCH] Fix typos in comments and test code --- src/NLog.sln.DotSettings | 8 +++- src/NLog/Annotations.cs | 2 +- src/NLog/Common/InternalLogger.cs | 2 +- .../ConditionRelationalExpression.cs | 2 +- src/NLog/Config/ConfigurationItemFactory.cs | 2 +- src/NLog/Config/ExceptionRenderingFormat.cs | 2 +- src/NLog/Config/Factory.cs | 2 +- src/NLog/Config/LoggerNameMatcher.cs | 2 +- src/NLog/Config/XmlLoggingConfiguration.cs | 4 +- .../FileAppenders/BaseFileAppender.cs | 4 +- .../CountingSingleProcessFileAppender.cs | 2 +- .../FileAppenders/FileAppenderCache.cs | 2 +- .../MutexMultiProcessFileAppender.cs | 2 +- .../RetryingMultiProcessFileAppender.cs | 2 +- .../SingleProcessFileAppender.cs | 2 +- .../UnixMultiProcessFileAppender.cs | 2 +- .../WindowsMultiProcessFileAppender.cs | 2 +- src/NLog/Internal/LayoutHelpers-generated.cs | 4 +- .../NetworkSenders/HttpNetworkSender.cs | 2 +- src/NLog/Internal/StringBuilderExt.cs | 2 +- src/NLog/Internal/XmlHelper.cs | 2 +- src/NLog/LayoutRenderers/LayoutRenderer.cs | 4 +- .../LayoutRenderers/RegistryLayoutRenderer.cs | 2 +- .../XmlEncodeLayoutRendererWrapper.cs | 2 +- src/NLog/Layouts/Layout.cs | 8 ++-- src/NLog/Layouts/LayoutParser.cs | 2 +- src/NLog/LogManager.cs | 2 +- src/NLog/MessageTemplates/ValueFormatter.cs | 2 +- src/NLog/Targets/AsyncTaskTarget.cs | 4 +- src/NLog/Targets/DefaultJsonSerializer.cs | 6 +-- src/NLog/Targets/FileTarget.cs | 12 ++--- src/NLog/Targets/JsonSerializeOptions.cs | 2 +- src/NLog/Targets/MailTarget.cs | 2 +- src/NLog/Targets/Target.cs | 4 +- src/NLog/Targets/WebServiceTarget.cs | 2 +- .../Targets/Wrappers/AsyncTargetWrapper.cs | 2 +- .../Wrappers/AutoFlushTargetWrapper.cs | 2 +- .../Conditions/ConditionEvaluatorTests.cs | 4 +- tests/NLog.UnitTests/Config/ExtensionTests.cs | 12 ++--- .../FileAppenders/FileAppenderCacheTests.cs | 2 +- .../Internal/LayoutHelpersTests.cs | 2 +- .../LayoutRenderers/ExceptionTests.cs | 2 +- .../Layouts/SimpleLayoutParserTests.cs | 2 +- .../LogReceiverServiceTests.cs | 22 +++++----- tests/NLog.UnitTests/LoggerTests.cs | 4 +- .../Targets/ColoredConsoleTargetTests.cs | 2 +- .../Targets/ConcurrentFileTargetTests.cs | 22 +++++----- .../NLog.UnitTests/Targets/FileTargetTests.cs | 8 ++-- .../Targets/WebServiceTargetTests.cs | 44 +++++++++---------- .../Wrappers/LimitingTargetWrapperTests.cs | 2 +- 50 files changed, 123 insertions(+), 117 deletions(-) diff --git a/src/NLog.sln.DotSettings b/src/NLog.sln.DotSettings index 059ce044ac..7799226a3d 100644 --- a/src/NLog.sln.DotSettings +++ b/src/NLog.sln.DotSettings @@ -7,4 +7,10 @@ DO_NOT_SHOW EOF GDC - MDC \ No newline at end of file + MDC + True + True + True + True + True + True \ No newline at end of file diff --git a/src/NLog/Annotations.cs b/src/NLog/Annotations.cs index 62552e7eba..03807640d7 100644 --- a/src/NLog/Annotations.cs +++ b/src/NLog/Annotations.cs @@ -208,7 +208,7 @@ public NotifyPropertyChangedInvocatorAttribute([NotNull] string parameterName) /// /// If method has single input parameter, it's name could be omitted.
/// Using halt (or void/nothing, which is the same) for method output - /// means that the methos doesn't return normally (throws or terminates the process).
+ /// means that the methods doesn't return normally (throws or terminates the process).
/// Value canbenull is only applicable for output parameters.
/// You can use multiple [ContractAnnotation] for each FDT row, or use single attribute /// with rows separated by semicolon. There is no notion of order rows, all rows are checked diff --git a/src/NLog/Common/InternalLogger.cs b/src/NLog/Common/InternalLogger.cs index d0e85fda10..809c6500b9 100644 --- a/src/NLog/Common/InternalLogger.cs +++ b/src/NLog/Common/InternalLogger.cs @@ -452,7 +452,7 @@ private static void WriteToErrorConsole(string message) /// A message to write. /// /// Works when property set to true. - /// The is used in Debug and Relese configuration. + /// The is used in Debug and Relaese configuration. /// The works only in Debug configuration and this is reason why is replaced by . /// in DEBUG /// diff --git a/src/NLog/Conditions/ConditionRelationalExpression.cs b/src/NLog/Conditions/ConditionRelationalExpression.cs index 32eea0631a..c6dcf02b90 100644 --- a/src/NLog/Conditions/ConditionRelationalExpression.cs +++ b/src/NLog/Conditions/ConditionRelationalExpression.cs @@ -177,7 +177,7 @@ private static void PromoteTypes(ref object leftValue, ref object rightValue) } /// - /// Promoto to type + /// Promotes to type /// /// /// diff --git a/src/NLog/Config/ConfigurationItemFactory.cs b/src/NLog/Config/ConfigurationItemFactory.cs index a9322b78b0..2d94716afc 100644 --- a/src/NLog/Config/ConfigurationItemFactory.cs +++ b/src/NLog/Config/ConfigurationItemFactory.cs @@ -317,7 +317,7 @@ private void CallPreload(Type type) var parameters = CreatePreloadParameters(preloadMethod, this); preloadMethod.Invoke(null, parameters); - InternalLogger.Debug("Preload succesfully invoked for '{0}'", type.FullName); + InternalLogger.Debug("Preload successfully invoked for '{0}'", type.FullName); } catch (Exception e) { diff --git a/src/NLog/Config/ExceptionRenderingFormat.cs b/src/NLog/Config/ExceptionRenderingFormat.cs index 9776db2e36..5f208da604 100644 --- a/src/NLog/Config/ExceptionRenderingFormat.cs +++ b/src/NLog/Config/ExceptionRenderingFormat.cs @@ -34,7 +34,7 @@ namespace NLog.Config { /// - /// Format of the excpetion output to the specific target. + /// Format of the exception output to the specific target. /// public enum ExceptionRenderingFormat { diff --git a/src/NLog/Config/Factory.cs b/src/NLog/Config/Factory.cs index ac1d1e23bb..2d8d04bd31 100644 --- a/src/NLog/Config/Factory.cs +++ b/src/NLog/Config/Factory.cs @@ -249,7 +249,7 @@ public void RegisterFuncLayout(string name, FuncLayoutRenderer renderer) /// True if instance was created successfully, false otherwise. public override bool TryCreateInstance(string itemName, out LayoutRenderer result) { - //first try func renderers, as they should have the possiblity to overwrite a current one. + //first try func renderers, as they should have the possibility to overwrite a current one. if (_funcRenderers != null) { FuncLayoutRenderer funcResult; diff --git a/src/NLog/Config/LoggerNameMatcher.cs b/src/NLog/Config/LoggerNameMatcher.cs index e84ada3b1e..dfc1a81fa8 100644 --- a/src/NLog/Config/LoggerNameMatcher.cs +++ b/src/NLog/Config/LoggerNameMatcher.cs @@ -236,7 +236,7 @@ public override bool NameMatches(string loggerName) /// /// Defines a that matches with a complex wildcards combinations: /// - /// '*' means zero or more occurrecnces of any character + /// '*' means zero or more occurrences of any character /// '?' means exactly one occurrence of any character /// /// used when pattern is a string containing any number of '?' or '*' in any position diff --git a/src/NLog/Config/XmlLoggingConfiguration.cs b/src/NLog/Config/XmlLoggingConfiguration.cs index 719a989854..a14a292252 100644 --- a/src/NLog/Config/XmlLoggingConfiguration.cs +++ b/src/NLog/Config/XmlLoggingConfiguration.cs @@ -125,7 +125,7 @@ private static XmlReader CreateFileReader(string fileName) { fileName = fileName.Trim(); #if __ANDROID__ - //suport loading config from special assets folder in nlog.config + //support loading config from special assets folder in nlog.config if (fileName.StartsWith(AssetsPrefix, StringComparison.OrdinalIgnoreCase)) { //remove prefix @@ -597,7 +597,7 @@ private void ConfigureFromFilesByMask(string baseDirectory, string fileMask, boo #endif foreach (var file in files) { - //note we exclude ourself in ConfigureFromFile + //note we exclude our self in ConfigureFromFile ConfigureFromFile(file, autoReloadDefault); } } diff --git a/src/NLog/Internal/FileAppenders/BaseFileAppender.cs b/src/NLog/Internal/FileAppenders/BaseFileAppender.cs index 0ed3daeb9c..3350675051 100644 --- a/src/NLog/Internal/FileAppenders/BaseFileAppender.cs +++ b/src/NLog/Internal/FileAppenders/BaseFileAppender.cs @@ -92,7 +92,7 @@ internal set public DateTime CreationTimeSource { get; private set; } /// - /// Gets the last time the file associated with the appeander is opened. The time returned is in Coordinated + /// Gets the last time the file associated with the appender is opened. The time returned is in Coordinated /// Universal Time [UTC] standard. /// /// The time the file was last opened. @@ -133,7 +133,7 @@ public void Write(byte[] bytes) public abstract DateTime? GetFileCreationTimeUtc(); /// - /// Gets the length in bytes of the file associated with the appeander. + /// Gets the length in bytes of the file associated with the appender. /// /// A long value representing the length of the file in bytes. public abstract long? GetFileLength(); diff --git a/src/NLog/Internal/FileAppenders/CountingSingleProcessFileAppender.cs b/src/NLog/Internal/FileAppenders/CountingSingleProcessFileAppender.cs index b46f55b760..b4c5fcb97b 100644 --- a/src/NLog/Internal/FileAppenders/CountingSingleProcessFileAppender.cs +++ b/src/NLog/Internal/FileAppenders/CountingSingleProcessFileAppender.cs @@ -117,7 +117,7 @@ public override void Flush() } /// - /// Gets the length in bytes of the file associated with the appeander. + /// Gets the length in bytes of the file associated with the appender. /// /// A long value representing the length of the file in bytes. public override long? GetFileLength() diff --git a/src/NLog/Internal/FileAppenders/FileAppenderCache.cs b/src/NLog/Internal/FileAppenders/FileAppenderCache.cs index 8b8e42735c..fb0505ab36 100644 --- a/src/NLog/Internal/FileAppenders/FileAppenderCache.cs +++ b/src/NLog/Internal/FileAppenders/FileAppenderCache.cs @@ -339,7 +339,7 @@ public void CloseAppenders(string reason) } /// - /// Close the allocated appenders initialised before the supplied time. + /// Close the allocated appenders initialized before the supplied time. /// /// The time which prior the appenders considered expired public void CloseAppenders(DateTime expireTime) diff --git a/src/NLog/Internal/FileAppenders/MutexMultiProcessFileAppender.cs b/src/NLog/Internal/FileAppenders/MutexMultiProcessFileAppender.cs index 2bbd143ce0..1cdba25f86 100644 --- a/src/NLog/Internal/FileAppenders/MutexMultiProcessFileAppender.cs +++ b/src/NLog/Internal/FileAppenders/MutexMultiProcessFileAppender.cs @@ -193,7 +193,7 @@ public override void Flush() } /// - /// Gets the length in bytes of the file associated with the appeander. + /// Gets the length in bytes of the file associated with the appender. /// /// A long value representing the length of the file in bytes. public override long? GetFileLength() diff --git a/src/NLog/Internal/FileAppenders/RetryingMultiProcessFileAppender.cs b/src/NLog/Internal/FileAppenders/RetryingMultiProcessFileAppender.cs index 750b59f918..0ae46c138d 100644 --- a/src/NLog/Internal/FileAppenders/RetryingMultiProcessFileAppender.cs +++ b/src/NLog/Internal/FileAppenders/RetryingMultiProcessFileAppender.cs @@ -101,7 +101,7 @@ public override void Close() } /// - /// Gets the length in bytes of the file associated with the appeander. + /// Gets the length in bytes of the file associated with the appender. /// /// A long value representing the length of the file in bytes. public override long? GetFileLength() diff --git a/src/NLog/Internal/FileAppenders/SingleProcessFileAppender.cs b/src/NLog/Internal/FileAppenders/SingleProcessFileAppender.cs index d366227741..4a33d86869 100644 --- a/src/NLog/Internal/FileAppenders/SingleProcessFileAppender.cs +++ b/src/NLog/Internal/FileAppenders/SingleProcessFileAppender.cs @@ -137,7 +137,7 @@ public override void Close() } /// - /// Gets the length in bytes of the file associated with the appeander. + /// Gets the length in bytes of the file associated with the appender. /// /// A long value representing the length of the file in bytes. public override long? GetFileLength() diff --git a/src/NLog/Internal/FileAppenders/UnixMultiProcessFileAppender.cs b/src/NLog/Internal/FileAppenders/UnixMultiProcessFileAppender.cs index 6acebe8711..d1a5b9581c 100644 --- a/src/NLog/Internal/FileAppenders/UnixMultiProcessFileAppender.cs +++ b/src/NLog/Internal/FileAppenders/UnixMultiProcessFileAppender.cs @@ -183,7 +183,7 @@ public override void Close() } /// - /// Gets the length in bytes of the file associated with the appeander. + /// Gets the length in bytes of the file associated with the appender. /// /// A long value representing the length of the file in bytes. public override long? GetFileLength() diff --git a/src/NLog/Internal/FileAppenders/WindowsMultiProcessFileAppender.cs b/src/NLog/Internal/FileAppenders/WindowsMultiProcessFileAppender.cs index 26c92cb982..8eb09eb695 100644 --- a/src/NLog/Internal/FileAppenders/WindowsMultiProcessFileAppender.cs +++ b/src/NLog/Internal/FileAppenders/WindowsMultiProcessFileAppender.cs @@ -204,7 +204,7 @@ public override void Flush() } /// - /// Gets the length in bytes of the file associated with the appeander. + /// Gets the length in bytes of the file associated with the appender. /// /// A long value representing the length of the file in bytes. public override long? GetFileLength() diff --git a/src/NLog/Internal/LayoutHelpers-generated.cs b/src/NLog/Internal/LayoutHelpers-generated.cs index 853848eece..d1c0b4d7d9 100644 --- a/src/NLog/Internal/LayoutHelpers-generated.cs +++ b/src/NLog/Internal/LayoutHelpers-generated.cs @@ -67,7 +67,7 @@ public static short RenderShort(this Layout layout, LogEventInfo logEvent, short short result; // NumberStyles.Integer is default of Convert.ToInt16 - // CultureInfo.InvariantCulture is backwardscomp. + // CultureInfo.InvariantCulture is backwards-compatible. if (!short.TryParse(rendered, NumberStyles.Integer, CultureInfo.InvariantCulture, out result)) { InternalLogger.Warn(layoutName + ": parse of value '" + rendered + "' failed, return " + defaultValue); @@ -101,7 +101,7 @@ public static int RenderInt(this Layout layout, LogEventInfo logEvent, int defau int result; // NumberStyles.Integer is default of Convert.ToInt16 - // CultureInfo.InvariantCulture is backwardscomp. + // CultureInfo.InvariantCulture is backwards-compatibility. if (!int.TryParse(rendered, NumberStyles.Integer, CultureInfo.InvariantCulture, out result)) { InternalLogger.Warn(layoutName + ": parse of value '" + rendered + "' failed, return " + defaultValue); diff --git a/src/NLog/Internal/NetworkSenders/HttpNetworkSender.cs b/src/NLog/Internal/NetworkSenders/HttpNetworkSender.cs index 4c929cf94e..436f67e60d 100644 --- a/src/NLog/Internal/NetworkSenders/HttpNetworkSender.cs +++ b/src/NLog/Internal/NetworkSenders/HttpNetworkSender.cs @@ -76,7 +76,7 @@ protected override void DoSend(byte[] bytes, int offset, int length, AsyncContin { using (var response = webRequest.EndGetResponse(r)) { - // Response succesfully read + // Response successfully read } // completed fine diff --git a/src/NLog/Internal/StringBuilderExt.cs b/src/NLog/Internal/StringBuilderExt.cs index c489928b0e..7cc88a091f 100644 --- a/src/NLog/Internal/StringBuilderExt.cs +++ b/src/NLog/Internal/StringBuilderExt.cs @@ -332,7 +332,7 @@ internal static void Append4DigitsZeroPadded(this StringBuilder builder, int num } /// - /// Apend a int type (byte, int) as string + /// Append a int type (byte, int) as string /// internal static void AppendIntegerAsString(this StringBuilder sb, IConvertible value, TypeCode objTypeCode) { diff --git a/src/NLog/Internal/XmlHelper.cs b/src/NLog/Internal/XmlHelper.cs index 7e8684bbee..081cfa6f16 100644 --- a/src/NLog/Internal/XmlHelper.cs +++ b/src/NLog/Internal/XmlHelper.cs @@ -214,7 +214,7 @@ internal static string XmlConvertToElementName(string xmlElementName, bool allow bool includeChr = false; switch (chr) { - case ':': // namespace-delimeter + case ':': // namespace-delimiter if (i != 0 && allowNamespace) { allowNamespace = false; diff --git a/src/NLog/LayoutRenderers/LayoutRenderer.cs b/src/NLog/LayoutRenderers/LayoutRenderer.cs index 2db14530d2..20fe4b0db6 100644 --- a/src/NLog/LayoutRenderers/LayoutRenderer.cs +++ b/src/NLog/LayoutRenderers/LayoutRenderer.cs @@ -258,7 +258,7 @@ public static void Register(string name) /// /// Register a custom layout renderer. /// - /// Short-cut for registing to default + /// Short-cut for registering to default /// Type of the layout renderer. /// Name of the layout renderer - without ${}. public static void Register(string name, Type layoutRendererType) @@ -268,7 +268,7 @@ public static void Register(string name, Type layoutRendererType) } /// - /// Register a custom layout renderer with a callback function . The callback recieves the logEvent. + /// Register a custom layout renderer with a callback function . The callback receives the logEvent. /// /// Name of the layout renderer - without ${}. /// Callback that returns the value for the layout renderer. diff --git a/src/NLog/LayoutRenderers/RegistryLayoutRenderer.cs b/src/NLog/LayoutRenderers/RegistryLayoutRenderer.cs index d443edd3dc..cfd41eb301 100644 --- a/src/NLog/LayoutRenderers/RegistryLayoutRenderer.cs +++ b/src/NLog/LayoutRenderers/RegistryLayoutRenderer.cs @@ -73,7 +73,7 @@ public RegistryLayoutRenderer() public Layout DefaultValue { get; set; } /// - /// Require escaping backward slashes in . Need to be backwardscompatible. + /// Require escaping backward slashes in . Need to be backwards-compatible. /// /// When true: /// diff --git a/src/NLog/LayoutRenderers/Wrappers/XmlEncodeLayoutRendererWrapper.cs b/src/NLog/LayoutRenderers/Wrappers/XmlEncodeLayoutRendererWrapper.cs index bbab581ab0..c29582d92a 100644 --- a/src/NLog/LayoutRenderers/Wrappers/XmlEncodeLayoutRendererWrapper.cs +++ b/src/NLog/LayoutRenderers/Wrappers/XmlEncodeLayoutRendererWrapper.cs @@ -66,7 +66,7 @@ public XmlEncodeLayoutRendererWrapper() public bool XmlEncode { get; set; } /// - /// Gets or sets a value indicating whether to tranform newlines (\r\n) into ( ) + /// Gets or sets a value indicating whether to transform newlines (\r\n) into ( ) /// /// [DefaultValue(false)] diff --git a/src/NLog/Layouts/Layout.cs b/src/NLog/Layouts/Layout.cs index c6af980ac4..29a7ac391c 100644 --- a/src/NLog/Layouts/Layout.cs +++ b/src/NLog/Layouts/Layout.cs @@ -118,7 +118,7 @@ public static Layout FromString(string layoutText, ConfigurationItemFactory conf /// Precalculates the layout for the specified log event and stores the result /// in per-log event cache. /// - /// Only if the layout doesn't have [ThreadAgnostic] and doens't contain layouts with [ThreadAgnostic]. + /// Only if the layout doesn't have [ThreadAgnostic] and doesn't contain layouts with [ThreadAgnostic]. /// /// The log event. /// @@ -291,7 +291,7 @@ internal void PerformObjectScanning() MutableUnsafe = objectGraphScannerList.Any(item => item.GetType().IsDefined(typeof(MutableUnsafeAttribute), true)); // determine the max StackTraceUsage, to decide if Logger needs to capture callsite - StackTraceUsage = StackTraceUsage.None; // Incase this Layout should implement IUsesStackTrace + StackTraceUsage = StackTraceUsage.None; // In case this Layout should implement IUsesStackTrace StackTraceUsage = objectGraphScannerList.OfType().DefaultIfEmpty().Max(item => item?.StackTraceUsage ?? StackTraceUsage.None); _scannedForObjects = true; @@ -335,7 +335,7 @@ protected virtual void CloseLayout() /// /// Register a custom Layout. /// - /// Short-cut for registing to default + /// Short-cut for registering to default /// Type of the Layout. /// Name of the Layout. public static void Register(string name) @@ -348,7 +348,7 @@ public static void Register(string name) /// /// Register a custom Layout. /// - /// Short-cut for registing to default + /// Short-cut for registering to default /// Type of the Layout. /// Name of the Layout. public static void Register(string name, Type layoutType) diff --git a/src/NLog/Layouts/LayoutParser.cs b/src/NLog/Layouts/LayoutParser.cs index 8e081b7e7c..403d10b009 100644 --- a/src/NLog/Layouts/LayoutParser.cs +++ b/src/NLog/Layouts/LayoutParser.cs @@ -78,7 +78,7 @@ internal static LayoutRenderer[] CompileLayout(ConfigurationItemFactory configur } else { - //dont treat \ as escape char and just read it + //don't treat \ as escape char and just read it literalBuf.Append('\\'); } continue; diff --git a/src/NLog/LogManager.cs b/src/NLog/LogManager.cs index 725467964b..341e3c3c6c 100644 --- a/src/NLog/LogManager.cs +++ b/src/NLog/LogManager.cs @@ -105,7 +105,7 @@ public static bool ThrowExceptions /// /// A value of true if exception should be thrown; otherwise, false. /// - /// This option is for backwards-compatiblity. + /// This option is for backwards-compatibility. /// By default exceptions are not thrown under any circumstances. /// /// diff --git a/src/NLog/MessageTemplates/ValueFormatter.cs b/src/NLog/MessageTemplates/ValueFormatter.cs index bb40d19461..f2bdbc6759 100644 --- a/src/NLog/MessageTemplates/ValueFormatter.cs +++ b/src/NLog/MessageTemplates/ValueFormatter.cs @@ -42,7 +42,7 @@ namespace NLog.MessageTemplates { /// - /// Convert Render or serialize a value, with optionnally backwardscompatible with + /// Convert Render or serialize a value, with optionally backwards-compatible with /// internal class ValueFormatter : IValueFormatter { diff --git a/src/NLog/Targets/AsyncTaskTarget.cs b/src/NLog/Targets/AsyncTaskTarget.cs index d14ed09e5f..b2f6e1d737 100644 --- a/src/NLog/Targets/AsyncTaskTarget.cs +++ b/src/NLog/Targets/AsyncTaskTarget.cs @@ -364,7 +364,7 @@ protected override void Dispose(bool disposing) /// /// Checks the internal queue for the next to create a new task for /// - /// Used for race-condition validation betweewn task-completion and timeout + /// Used for race-condition validation between task-completion and timeout /// Signals whether previousTask completed an almost full BatchSize private void TaskStartNext(object previousTask, bool fullBatchCompleted) { @@ -589,7 +589,7 @@ private void NotifyTaskCompletion(IList reusableContinuations } /// - /// Handles that scheduled task has completed (succesfully or failed), and starts the next pending task + /// Handles that scheduled task has completed (successfully or failed), and starts the next pending task /// /// Task just completed /// AsyncContinuation to notify of success or failure diff --git a/src/NLog/Targets/DefaultJsonSerializer.cs b/src/NLog/Targets/DefaultJsonSerializer.cs index d130be1056..185e79a903 100644 --- a/src/NLog/Targets/DefaultJsonSerializer.cs +++ b/src/NLog/Targets/DefaultJsonSerializer.cs @@ -152,7 +152,7 @@ public string SerializeObject(object value, JsonSerializeOptions options) /// /// The object to serialize to JSON. /// Write the resulting JSON to this destination. - /// Object serialized succesfully (true/false). + /// Object serialized successfully (true/false). public bool SerializeObject(object value, StringBuilder destination) { return SerializeObject(value, destination, _serializeOptions); @@ -164,7 +164,7 @@ public bool SerializeObject(object value, StringBuilder destination) /// The object to serialize to JSON. /// Write the resulting JSON to this destination. /// serialisation options - /// Object serialized succesfully (true/false). + /// Object serialized successfully (true/false). public bool SerializeObject(object value, StringBuilder destination, JsonSerializeOptions options) { return SerializeObject(value, destination, options, default(SingleItemOptimizedHashSet), 0); @@ -178,7 +178,7 @@ public bool SerializeObject(object value, StringBuilder destination, JsonSeriali /// serialisation options /// The objects in path (Avoid cyclic reference loop). /// The current depth (level) of recursion. - /// Object serialized succesfully (true/false). + /// Object serialized successfully (true/false). private bool SerializeObject(object value, StringBuilder destination, JsonSerializeOptions options, SingleItemOptimizedHashSet objectsInPath, int depth) { int originalLength = destination.Length; diff --git a/src/NLog/Targets/FileTarget.cs b/src/NLog/Targets/FileTarget.cs index 4e1a371700..3d95b8d0e9 100644 --- a/src/NLog/Targets/FileTarget.cs +++ b/src/NLog/Targets/FileTarget.cs @@ -64,14 +64,14 @@ namespace NLog.Targets public class FileTarget : TargetWithLayoutHeaderAndFooter, ICreateFileParameters { /// - /// Default clean up period of the initilized files. When a file exceeds the clean up period is removed from the list. + /// Default clean up period of the initialized files. When a file exceeds the clean up period is removed from the list. /// /// Clean up period is defined in days. private const int InitializedFilesCleanupPeriod = 2; /// - /// The maximum number of initialised files before clean up procedures are initiated, - /// to keep the number of initialised files to a minimum. Chose 25 to cater for monthly rolling of log-files. + /// The maximum number of initialized files before clean up procedures are initiated, + /// to keep the number of initialized files to a minimum. Chose 25 to cater for monthly rolling of log-files. /// private const int InitializedFilesCounterMax = 25; @@ -100,7 +100,7 @@ IFileArchiveMode GetFileArchiveHelper(string archiveFilePattern) private Timer _autoClosingTimer; /// - /// The number of initialised files at any one time. + /// The number of initialized files at any one time. /// private int _initializedFilesCounter; @@ -1479,7 +1479,7 @@ private string GetArchiveDateFormatString(string defaultFormat) private DateTime? GetArchiveDate(string fileName, LogEventInfo logEvent, DateTime previousLogEventTimestamp) { - // Using File LastModifed to handle FileArchivePeriod.Month (where file creation time is one month ago) + // Using File LastModified to handle FileArchivePeriod.Month (where file creation time is one month ago) var fileLastModifiedUtc = _fileAppenderCache.GetFileLastWriteTimeUtc(fileName); InternalLogger.Trace("FileTarget(Name={0}): Calculating archive date. File-LastModifiedUtc: {1}; Previous LogEvent-TimeStamp: {2}", Name, fileLastModifiedUtc, previousLogEventTimestamp); @@ -2154,7 +2154,7 @@ private void WriteToFile(string fileName, ArraySegment bytes, bool initial } /// - /// Initialise a file to be used by the instance. Based on the number of initialised + /// Initialise a file to be used by the instance. Based on the number of initialized /// files and the values of various instance properties clean up and/or archiving processes can be invoked. /// /// File name to be written. diff --git a/src/NLog/Targets/JsonSerializeOptions.cs b/src/NLog/Targets/JsonSerializeOptions.cs index 40331201d2..78e5bbfccd 100644 --- a/src/NLog/Targets/JsonSerializeOptions.cs +++ b/src/NLog/Targets/JsonSerializeOptions.cs @@ -42,7 +42,7 @@ namespace NLog.Targets public class JsonSerializeOptions { /// - /// Add quotes arround object keys? + /// Add quotes around object keys? /// [DefaultValue(true)] public bool QuoteKeys { get; set; } diff --git a/src/NLog/Targets/MailTarget.cs b/src/NLog/Targets/MailTarget.cs index 0816367a9b..1723d7751d 100644 --- a/src/NLog/Targets/MailTarget.cs +++ b/src/NLog/Targets/MailTarget.cs @@ -324,7 +324,7 @@ public Layout Body /// /// Gets or sets a value indicating the SMTP client timeout. /// - /// Warning: zero is not infinit waiting + /// Warning: zero is not infinite waiting /// [DefaultValue(10000)] public int Timeout { get; set; } diff --git a/src/NLog/Targets/Target.cs b/src/NLog/Targets/Target.cs index 58ae68e050..b358f3188b 100644 --- a/src/NLog/Targets/Target.cs +++ b/src/NLog/Targets/Target.cs @@ -771,7 +771,7 @@ private static bool TryGetCachedValue(Layout layout, LogEventInfo logEvent, out /// /// Register a custom Target. /// - /// Short-cut for registing to default + /// Short-cut for registering to default /// Type of the Target. /// Name of the Target. public static void Register(string name) @@ -784,7 +784,7 @@ public static void Register(string name) /// /// Register a custom Target. /// - /// Short-cut for registing to default + /// Short-cut for registering to default /// Type of the Target. /// Name of the Target. public static void Register(string name, Type targetType) diff --git a/src/NLog/Targets/WebServiceTarget.cs b/src/NLog/Targets/WebServiceTarget.cs index 11020ec17f..0ea42ed908 100644 --- a/src/NLog/Targets/WebServiceTarget.cs +++ b/src/NLog/Targets/WebServiceTarget.cs @@ -364,7 +364,7 @@ private AsyncContinuation CreateSendContinuation(AsyncContinuation continuation, { using (var response = request.EndGetResponse(r)) { - // Request succesfully initialized + // Request successfully initialized } DoInvokeCompleted(continuation, null); diff --git a/src/NLog/Targets/Wrappers/AsyncTargetWrapper.cs b/src/NLog/Targets/Wrappers/AsyncTargetWrapper.cs index c5cf57d476..d1fe1d3b75 100644 --- a/src/NLog/Targets/Wrappers/AsyncTargetWrapper.cs +++ b/src/NLog/Targets/Wrappers/AsyncTargetWrapper.cs @@ -155,7 +155,7 @@ public AsyncTargetWrapper(Target wrappedTarget, int queueLimit, AsyncTargetWrapp /// /// Raise event when Target cannot store LogEvent. - /// Event arg contains losed LogEvent + /// Event arg contains lost LogEvents /// public event EventHandler LogEventDropped { diff --git a/src/NLog/Targets/Wrappers/AutoFlushTargetWrapper.cs b/src/NLog/Targets/Wrappers/AutoFlushTargetWrapper.cs index adc2da8080..2a55901f19 100644 --- a/src/NLog/Targets/Wrappers/AutoFlushTargetWrapper.cs +++ b/src/NLog/Targets/Wrappers/AutoFlushTargetWrapper.cs @@ -38,7 +38,7 @@ namespace NLog.Targets.Wrappers using NLog.Internal; /// - /// Causes a flush on a wrapped target if LogEvent statisfies the . + /// Causes a flush on a wrapped target if LogEvent satisfies the . /// If condition isn't set, flushes on each write. /// /// Documentation on NLog Wiki diff --git a/tests/NLog.UnitTests/Conditions/ConditionEvaluatorTests.cs b/tests/NLog.UnitTests/Conditions/ConditionEvaluatorTests.cs index f30cbdc70b..fd874b2341 100644 --- a/tests/NLog.UnitTests/Conditions/ConditionEvaluatorTests.cs +++ b/tests/NLog.UnitTests/Conditions/ConditionEvaluatorTests.cs @@ -81,7 +81,7 @@ public void ConditionMethodsTest() AssertEvaluationResult(true, "regex-matches('foo', '^foo$')"); AssertEvaluationResult(false, "regex-matches('foo', '^bar$')"); - //Check that calling with empty strign is equivalent with not passing the parameter + //Check that calling with empty string is equivalent with not passing the parameter AssertEvaluationResult(true, "regex-matches('foo', '^foo$', '')"); AssertEvaluationResult(false, "regex-matches('foo', '^bar$', '')"); @@ -242,7 +242,7 @@ public void TypePromotionTest() Assert.Equal(false, ConditionParser.ParseExpression("false == ToInt16(4)", factories).Evaluate(CreateWellKnownContext())); Assert.Equal(false, ConditionParser.ParseExpression("ToInt16(1) == false", factories).Evaluate(CreateWellKnownContext())); - //this is doing string comparision as thats the common type which works in this case. + //this is doing string comparision as that's the common type which works in this case. Assert.Equal(false, ConditionParser.ParseExpression("ToDateTime('2010/01/01') == '20xx/01/01'", factories).Evaluate(CreateWellKnownContext())); } diff --git a/tests/NLog.UnitTests/Config/ExtensionTests.cs b/tests/NLog.UnitTests/Config/ExtensionTests.cs index eac4d56bb3..e7a870ffd3 100644 --- a/tests/NLog.UnitTests/Config/ExtensionTests.cs +++ b/tests/NLog.UnitTests/Config/ExtensionTests.cs @@ -503,13 +503,13 @@ public void Extensions_NLogPackageLoader_should_beCalled() var logs = writer.ToString(); - Assert.Contains("Preload succesfully invoked for 'LoaderTestInternal.NLogPackageLoader'", logs); - Assert.Contains("Preload succesfully invoked for 'LoaderTestPublic.NLogPackageLoader'", logs); - Assert.Contains("Preload succesfully invoked for 'LoaderTestPrivateNestedStatic.SomeType+NLogPackageLoader'", logs); - Assert.Contains("Preload succesfully invoked for 'LoaderTestPrivateNested.SomeType+NLogPackageLoader'", logs); + Assert.Contains("Preload successfully invoked for 'LoaderTestInternal.NLogPackageLoader'", logs); + Assert.Contains("Preload successfully invoked for 'LoaderTestPublic.NLogPackageLoader'", logs); + Assert.Contains("Preload successfully invoked for 'LoaderTestPrivateNestedStatic.SomeType+NLogPackageLoader'", logs); + Assert.Contains("Preload successfully invoked for 'LoaderTestPrivateNested.SomeType+NLogPackageLoader'", logs); - //4 times succesful - Assert.Equal(4, Regex.Matches(logs, Regex.Escape("Preload succesfully invoked for '")).Count); + //4 times successful + Assert.Equal(4, Regex.Matches(logs, Regex.Escape("Preload successfully invoked for '")).Count); } finally diff --git a/tests/NLog.UnitTests/Internal/FileAppenders/FileAppenderCacheTests.cs b/tests/NLog.UnitTests/Internal/FileAppenders/FileAppenderCacheTests.cs index bcdf95e155..d4b11632d8 100644 --- a/tests/NLog.UnitTests/Internal/FileAppenders/FileAppenderCacheTests.cs +++ b/tests/NLog.UnitTests/Internal/FileAppenders/FileAppenderCacheTests.cs @@ -124,7 +124,7 @@ public void FileAppenderCache_InvalidateAppender() // for the file. // - // Write, flush the content into the file and release the file. This happens throught the + // Write, flush the content into the file and release the file. This happens through the // InvalidateAppender() method. We need to release the file before invoking AssertFileContents() method. appender.Write(StringToBytes("NLog test string.")); cache.InvalidateAppender(tempFile); diff --git a/tests/NLog.UnitTests/Internal/LayoutHelpersTests.cs b/tests/NLog.UnitTests/Internal/LayoutHelpersTests.cs index 62131ac023..77303c39b4 100644 --- a/tests/NLog.UnitTests/Internal/LayoutHelpersTests.cs +++ b/tests/NLog.UnitTests/Internal/LayoutHelpersTests.cs @@ -97,7 +97,7 @@ public void TestRenderShort(string input, short expected) /// - /// test with both default. True or false, case insentive, no numbers + /// test with both default. True or false, case-insensitive, no numbers /// /// /// null = default diff --git a/tests/NLog.UnitTests/LayoutRenderers/ExceptionTests.cs b/tests/NLog.UnitTests/LayoutRenderers/ExceptionTests.cs index 0adbf252de..2b7726a2b4 100644 --- a/tests/NLog.UnitTests/LayoutRenderers/ExceptionTests.cs +++ b/tests/NLog.UnitTests/LayoutRenderers/ExceptionTests.cs @@ -654,7 +654,7 @@ private void SetConfigurationForExceptionUsingRootMethodTests() } /// - /// Get an excption with stacktrace by genating a exception + /// Get an exception with stacktrace by generating a exception /// /// /// diff --git a/tests/NLog.UnitTests/Layouts/SimpleLayoutParserTests.cs b/tests/NLog.UnitTests/Layouts/SimpleLayoutParserTests.cs index 0a7636e74a..d3320adc57 100644 --- a/tests/NLog.UnitTests/Layouts/SimpleLayoutParserTests.cs +++ b/tests/NLog.UnitTests/Layouts/SimpleLayoutParserTests.cs @@ -535,7 +535,7 @@ public void InvalidLayoutWillThrowIfExceptionThrowingIsOn() /// /// - /// Test layout with Genernic List type. - is the seperator + /// Test layout with Generic List type. - is the separator /// /// /// diff --git a/tests/NLog.UnitTests/LogReceiverService/LogReceiverServiceTests.cs b/tests/NLog.UnitTests/LogReceiverService/LogReceiverServiceTests.cs index f35482ac11..0e7967ee37 100644 --- a/tests/NLog.UnitTests/LogReceiverService/LogReceiverServiceTests.cs +++ b/tests/NLog.UnitTests/LogReceiverService/LogReceiverServiceTests.cs @@ -320,7 +320,7 @@ private void RealTestLogReciever(bool useOneWayContract, bool binaryEncode) "); - ExecLogRecieverAndCheck(ExecLogging1, CheckRecieved1, 2); + ExecLogRecieverAndCheck(ExecLogging1, CheckReceived1, 2); } @@ -328,7 +328,7 @@ private void RealTestLogReciever(bool useOneWayContract, bool binaryEncode) /// Create WCF service, logs and listen to the events /// /// function for logging the messages - /// function for checking the received messsages + /// function for checking the received messages /// message count for wait for listen and checking private void ExecLogRecieverAndCheck(Action logFunc, Action> logCheckFunc, int messageCount) { @@ -356,7 +356,7 @@ private void ExecLogRecieverAndCheck(Action logFunc, Action(); + LogRecieverMock.receivedEvents = new List(); LogRecieverMock.CountdownEvent = countdownEvent; var logger1 = LogManager.GetLogger("logger1"); @@ -365,27 +365,27 @@ private void ExecLogRecieverAndCheck(Action logFunc, Action recieved) + private static void CheckReceived1(List received) { //in some case the messages aren't retrieved in the right order when invoked in the same sec. //more important is that both are retrieved with the correct info - Assert.Equal(2, recieved.Count); + Assert.Equal(2, received.Count); - var logmessages = new HashSet { recieved[0].ToEventInfo().First().Message, recieved[1].ToEventInfo().First().Message }; + var logmessages = new HashSet { received[0].ToEventInfo().First().Message, received[1].ToEventInfo().First().Message }; Assert.True(logmessages.Contains("test 1"), "message 1 is missing"); Assert.True(logmessages.Contains("test 2"), "message 2 is missing"); @@ -405,7 +405,7 @@ public class LogRecieverMock : ILogReceiverServer, ILogReceiverOneWayServer public static CountdownEvent CountdownEvent; - public static List recievedEvents = new List(); + public static List receivedEvents = new List(); /// /// Processes the log messages. @@ -420,7 +420,7 @@ public void ProcessLogMessages(NLogEvents events) - recievedEvents.Add(events); + receivedEvents.Add(events); CountdownEvent.Signal(); } diff --git a/tests/NLog.UnitTests/LoggerTests.cs b/tests/NLog.UnitTests/LoggerTests.cs index e76d879fc2..2efce85695 100644 --- a/tests/NLog.UnitTests/LoggerTests.cs +++ b/tests/NLog.UnitTests/LoggerTests.cs @@ -1853,7 +1853,7 @@ public void SingleTargetMessageFormatOptimizationTest() [InlineData(true, "@Client", "1")] [InlineData(true, "0", "1")] [InlineData(false, "0", "1")] - [InlineData(true, "OrderId", "Client")] //succeeeds, but gives JSON like (no quoted key, missing quotes arround string, =, other spacing) + [InlineData(true, "OrderId", "Client")] //succeeds, but gives JSON like (no quoted key, missing quotes around string, =, other spacing) [InlineData(true, "OrderId", "@Client")] [InlineData(null, "OrderId", "@Client")] public void MixedStructuredEventsConfigTest(bool? parseMessageTemplates, string param1, string param2) @@ -2417,7 +2417,7 @@ public void LogEventTemplateShouldOverrideProperties() Assert.Equal(2, target.LastEvent.Properties.Count); AssertContainsInDictionary(target.LastEvent.Properties, "Stage", 1); AssertContainsInDictionary(target.LastEvent.Properties, "userid", "kermit"); - loggerStage2.Trace("Login succesful for {userid}", "kermit"); + loggerStage2.Trace("Login successful for {userid}", "kermit"); Assert.Equal(2, target.LastEvent.Properties.Count); AssertContainsInDictionary(target.LastEvent.Properties, "Stage", 2); AssertContainsInDictionary(target.LastEvent.Properties, "userid", "kermit"); diff --git a/tests/NLog.UnitTests/Targets/ColoredConsoleTargetTests.cs b/tests/NLog.UnitTests/Targets/ColoredConsoleTargetTests.cs index 207abcc597..7197ef6657 100644 --- a/tests/NLog.UnitTests/Targets/ColoredConsoleTargetTests.cs +++ b/tests/NLog.UnitTests/Targets/ColoredConsoleTargetTests.cs @@ -196,7 +196,7 @@ public void ColoredConsoleAnsi_RowColorWithWordHighlight_VerificationTest() } /// - /// With or wihout CompileRegex, CompileRegex is never null, even if not used when CompileRegex=false. (needed for backwardscomp) + /// With or without CompileRegex, CompileRegex is never null, even if not used when CompileRegex=false. (needed for backwards-compatibility) /// /// [Theory] diff --git a/tests/NLog.UnitTests/Targets/ConcurrentFileTargetTests.cs b/tests/NLog.UnitTests/Targets/ConcurrentFileTargetTests.cs index 63cdb56dbd..4a889cb780 100644 --- a/tests/NLog.UnitTests/Targets/ConcurrentFileTargetTests.cs +++ b/tests/NLog.UnitTests/Targets/ConcurrentFileTargetTests.cs @@ -202,11 +202,11 @@ private void DoConcurrentTest(int numProcesses, int numLogs, string mode) bool verifyFileSize = files.Count > 1; - var recievedNumbersSet = new List[numProcesses]; + var receivedNumbersSet = new List[numProcesses]; for (int i = 0; i < numProcesses; i++) { - var recievedNumbers = new List(numLogs); - recievedNumbersSet[i] = recievedNumbers; + var receivedNumbers = new List(numLogs); + receivedNumbersSet[i] = receivedNumbers; } //Console.WriteLine("Verifying output file {0}", logFile); @@ -226,7 +226,7 @@ private void DoConcurrentTest(int numProcesses, int numLogs, string mode) int number = Convert.ToInt32(tokens[1]); Assert.True(thread >= 0); Assert.True(thread < numProcesses); - recievedNumbersSet[thread].Add(number); + receivedNumbersSet[thread].Add(number); } @@ -250,23 +250,23 @@ private void DoConcurrentTest(int numProcesses, int numLogs, string mode) { for (; currentProcess < numProcesses; currentProcess++) { - var recievedNumbers = recievedNumbersSet[currentProcess]; + var receivedNumbers = receivedNumbersSet[currentProcess]; - var equalLength = expected.Count == recievedNumbers.Count; + var equalLength = expected.Count == receivedNumbers.Count; - var fastCheck = equalLength && expected.SequenceEqual(recievedNumbers); + var fastCheck = equalLength && expected.SequenceEqual(receivedNumbers); if (!fastCheck) //assert equals on two long lists in xUnit is lame. Not showing the difference. { if (equalLength) { - var reodered = recievedNumbers.OrderBy(i => i); + var reodered = receivedNumbers.OrderBy(i => i); equalsWhenReorderd = expected.SequenceEqual(reodered); } - Assert.Equal(string.Join(",", expected), string.Join(",", recievedNumbers)); + Assert.Equal(string.Join(",", expected), string.Join(",", receivedNumbers)); } } } @@ -297,7 +297,7 @@ private void DoConcurrentTest(int numProcesses, int numLogs, string mode) [InlineData(5, 4000, "none")] [InlineData(10, 2000, "none")] #if !MONO - // MONO Doesn't work well with global mutex, and it is needed for succesful concurrent archive operations + // MONO Doesn't work well with global mutex, and it is needed for successful concurrent archive operations [InlineData(2, 500, "none|archive")] [InlineData(2, 500, "none|mutex|archive")] [InlineData(2, 10000, "none|mutex")] @@ -317,7 +317,7 @@ public void SimpleConcurrentTest(int numProcesses, int numLogs, string mode) public void AsyncConcurrentTest(string mode) { // Before 2 processes are running into concurrent writes, - // the first process typically already has written couple thousend events. + // the first process typically already has written couple thousand events. // Thus to have a meaningful test, at least 10K events are required. // Due to the buffering it makes no big difference in runtime, whether we // have 2 process writing 10K events each or couple more processes with even more events. diff --git a/tests/NLog.UnitTests/Targets/FileTargetTests.cs b/tests/NLog.UnitTests/Targets/FileTargetTests.cs index 594432b8e9..9c9c98f308 100644 --- a/tests/NLog.UnitTests/Targets/FileTargetTests.cs +++ b/tests/NLog.UnitTests/Targets/FileTargetTests.cs @@ -274,7 +274,7 @@ public void SimpleFileTestWriteBom() #if !MONO /// - /// If a drive doesn't existing, before repeatatly creating a dir was tried. This test was taking +60 seconds + /// If a drive doesn't existing, before repeatably creating a dir was tried. This test was taking +60 seconds /// [Theory] [MemberData(nameof(SimpleFileTest_TestParameters))] @@ -992,7 +992,7 @@ public void SequentialArchiveTest() Path.Combine(archiveFolder, "0003.txt"), StringRepeat(times, "ddd\n"), Encoding.UTF8); - //0000 should not extists because of MaxArchiveFiles=3 + //0000 should not exists because of MaxArchiveFiles=3 Assert.True(!File.Exists(Path.Combine(archiveFolder, "0000.txt"))); Assert.True(!File.Exists(Path.Combine(archiveFolder, "0004.txt"))); } @@ -1198,7 +1198,7 @@ public void DeleteArchiveFilesByDate() //two files should still be there Assert.Equal(files.ElementAt(1), files2.ElementAt(0)); Assert.Equal(files.ElementAt(2), files2.ElementAt(1)); - //one new archive file shoud be created + //one new archive file should be created Assert.DoesNotContain(files2.ElementAt(2), files); } finally @@ -1846,7 +1846,7 @@ public void DeleteArchiveFilesByDate_AlteredMaxArchive() Assert.DoesNotContain(files.ElementAt(3), files2); //one files should still be there Assert.Equal(files.ElementAt(4), files2.ElementAt(0)); - //one new archive file shoud be created + //one new archive file should be created Assert.DoesNotContain(files2.ElementAt(1), files); } finally diff --git a/tests/NLog.UnitTests/Targets/WebServiceTargetTests.cs b/tests/NLog.UnitTests/Targets/WebServiceTargetTests.cs index 6010524744..1f3e8dbd7c 100644 --- a/tests/NLog.UnitTests/Targets/WebServiceTargetTests.cs +++ b/tests/NLog.UnitTests/Targets/WebServiceTargetTests.cs @@ -297,9 +297,9 @@ public void WebserviceTest_restapi_httppost() }); Assert.Equal(0, LogMeController.CountdownEvent.CurrentCount); - Assert.Equal(2, LogMeController.RecievedLogsPostParam1.Count); - CheckQueueMessage(message1, LogMeController.RecievedLogsPostParam1); - CheckQueueMessage(message2, LogMeController.RecievedLogsPostParam1); + Assert.Equal(2, LogMeController.ReceivedLogsPostParam1.Count); + CheckQueueMessage(message1, LogMeController.ReceivedLogsPostParam1); + CheckQueueMessage(message2, LogMeController.ReceivedLogsPostParam1); } /// @@ -323,9 +323,9 @@ public void WebserviceTest_restapi_httpget() Assert.Equal(0, LogMeController.CountdownEvent.CurrentCount); - Assert.Equal(2, LogMeController.RecievedLogsGetParam1.Count); - CheckQueueMessage(message1, LogMeController.RecievedLogsGetParam1); - CheckQueueMessage(message2, LogMeController.RecievedLogsGetParam1); + Assert.Equal(2, LogMeController.ReceivedLogsGetParam1.Count); + CheckQueueMessage(message1, LogMeController.ReceivedLogsGetParam1); + CheckQueueMessage(message2, LogMeController.ReceivedLogsGetParam1); } /// @@ -355,7 +355,7 @@ public void WebserviceTest_restapi_httpget_flush() LogManager.Flush(); // Nothing to flush }); - Assert.Equal(100, LogMeController.RecievedLogsGetParam1.Count); + Assert.Equal(100, LogMeController.ReceivedLogsGetParam1.Count); } [Fact] @@ -373,8 +373,8 @@ public void WebServiceTest_restapi_httpget_querystring() Assert.Equal(0, LogMeController.CountdownEvent.CurrentCount); - Assert.Single(LogMeController.RecievedLogsGetParam1); - CheckQueueMessage("another message", LogMeController.RecievedLogsGetParam1); + Assert.Single(LogMeController.ReceivedLogsGetParam1); + CheckQueueMessage("another message", LogMeController.ReceivedLogsGetParam1); } private static Logger SetUpHttpGetWebservice(string relativeUrl) @@ -406,9 +406,9 @@ private static Logger SetUpHttpGetWebservice(string relativeUrl) return logger; } - private static void CheckQueueMessage(string message1, ConcurrentBag recievedLogsGetParam1) + private static void CheckQueueMessage(string message1, ConcurrentBag receivedLogsGetParam1) { - var success = recievedLogsGetParam1.Contains(message1); + var success = receivedLogsGetParam1.Contains(message1); Assert.True(success, $"message '{message1}' not found"); } @@ -478,8 +478,8 @@ public void WebserviceTest_restapi_httppost_checkingLost() }); Assert.Equal(0, LogMeController.CountdownEvent.CurrentCount); - Assert.Equal(createdMessages.Count, LogMeController.RecievedLogsPostParam1.Count); - //Assert.Equal(createdMessages, ValuesController.RecievedLogsPostParam1); + Assert.Equal(createdMessages.Count, LogMeController.ReceivedLogsPostParam1.Count); + //Assert.Equal(createdMessages, ValuesController.ReceivedLogsPostParam1); }); } @@ -744,8 +744,8 @@ public class LogMeController : ApiController /// public static void ResetState(int expectedMessages) { - RecievedLogsPostParam1 = new ConcurrentBag(); - RecievedLogsGetParam1 = new ConcurrentBag(); + ReceivedLogsPostParam1 = new ConcurrentBag(); + ReceivedLogsGetParam1 = new ConcurrentBag(); if (expectedMessages > 0) CountdownEvent = new CountdownEvent(expectedMessages); else @@ -759,13 +759,13 @@ public static void ResetState(int expectedMessages) /// - /// Recieved param1 values (get) + /// Received param1 values (get) /// - public static ConcurrentBag RecievedLogsGetParam1 = new ConcurrentBag(); + public static ConcurrentBag ReceivedLogsGetParam1 = new ConcurrentBag(); /// - /// Recieved param1 values(post) + /// Received param1 values(post) /// - public static ConcurrentBag RecievedLogsPostParam1 = new ConcurrentBag(); + public static ConcurrentBag ReceivedLogsPostParam1 = new ConcurrentBag(); /// @@ -802,7 +802,7 @@ public string Get(int id) public IEnumerable Get(string param1 = "", string param2 = "") { - RecievedLogsGetParam1.Add(param1); + ReceivedLogsGetParam1.Add(param1); if (CountdownEvent != null) { CountdownEvent.Signal(); @@ -821,7 +821,7 @@ public void Post([FromBody] ComplexType complexType) { throw new ArgumentNullException(nameof(complexType)); } - RecievedLogsPostParam1.Add(complexType.Param1); + ReceivedLogsPostParam1.Add(complexType.Param1); if (CountdownEvent != null) { @@ -855,7 +855,7 @@ internal static void StartOwinTest(Action testsFunc) { testsFunc(); - //wait for all recieved message, or timeout. There is no exception on timeout, so we have to check carefully in the unit test. + //wait for all received message, or timeout. There is no exception on timeout, so we have to check carefully in the unit test. if (LogMeController.CountdownEvent != null) { LogMeController.CountdownEvent.Wait(webserviceCheckTimeoutMs); diff --git a/tests/NLog.UnitTests/Targets/Wrappers/LimitingTargetWrapperTests.cs b/tests/NLog.UnitTests/Targets/Wrappers/LimitingTargetWrapperTests.cs index 64c739f9ce..42d7b6d7dc 100644 --- a/tests/NLog.UnitTests/Targets/Wrappers/LimitingTargetWrapperTests.cs +++ b/tests/NLog.UnitTests/Targets/Wrappers/LimitingTargetWrapperTests.cs @@ -218,7 +218,7 @@ public void TestWritingMessagesOverMultipleIntervals() Thread.Sleep(20); lastException = WriteNumberAsyncLogEventsStartingAt(30, 10, wrapper); - //No more messages shouldve been written, since we are still in the third interval. + //No more messages should be been written, since we are still in the third interval. Assert.Equal(15, wrappedTarget.WriteCount); Assert.Equal("Hello 24", wrappedTarget.LastWrittenMessage); Assert.Null(lastException);