Skip to content

one home for the reflection in the tests - #326

Merged
FreeAndNil merged 1 commit into
masterfrom
Feature/326-test-reflection
Sep 25, 2026
Merged

FreeAndNil merged 1 commit into
masterfrom
Feature/326-test-reflection

Conversation

@FreeAndNil

Copy link
Copy Markdown
Contributor

One ReflectionExtensions in the test assembly replaces 27 hand written lookups over 13 files.
Test only, no production change, no changelog entry.

// before
=> (string)typeof(LocalSyslogAppender)
  .GetMethod("EscapePercent", BindingFlags.Static | BindingFlags.NonPublic)!
  .Invoke(null, [message])!;

// after
=> typeof(LocalSyslogAppender).Invoke<string>(nameof(EscapePercent), [message]);

A renamed member now fails with its own name instead of a NullReferenceException.

@FreeAndNil FreeAndNil added this to the 3.5.0 milestone Sep 22, 2026
ReflectionExtensions replaces 27 hand written lookups in 13 files.
A renamed member now fails with its own name instead of a NullReferenceException.
@FreeAndNil
FreeAndNil force-pushed the Feature/326-test-reflection branch from d9d4cc1 to 34fca46 Compare September 25, 2026 05:59
@FreeAndNil
FreeAndNil marked this pull request as ready for review September 25, 2026 05:59
@FreeAndNil
FreeAndNil merged commit 2cb51fa into master Sep 25, 2026
3 checks passed
@FreeAndNil
FreeAndNil deleted the Feature/326-test-reflection branch September 25, 2026 07:57
FreeAndNil added a commit that referenced this pull request Sep 28, 2026
…stead of dropping the client

Every throw from a Telnet write was read as a dead client, so a bug in what we write dropped every
client, one per event. That was f013.

Only `SocketException`, `IOException` and `ObjectDisposedException` disconnect now. The rest is
rethrown after the loop and reported by `BackgroundSender`.

Commit 2, test-only:

* `AdoNetAppenderTest` twice, `XmlConfiguratorTest`, `LogLogTest`, `StringFormatTest` once each
* ten provoked `log4net:ERROR` off stderr, two left, asserted by `LogLogTest`
* `CLAUDE.md` gets the `ReflectionExtensions` convention from #326
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants