Skip to content

Instantly share code, notes, and snippets.

View vcaraulean's full-sized avatar

Valeriu Caraulean vcaraulean

View GitHub Profile
@vcaraulean
vcaraulean / NunitEquivalentCollectionTests.cs
Created September 12, 2018 14:30
Nunit 3.10.1 and NUnit 3.9.0 have different results in asserting this scenario
[Test]
public void EquivalentCollection()
{
var c1 = new[] { 1, 2, 3 };
var c2 = new[] { 1, 2, 3 };
Assert.That(c1, Is.EquivalentTo(c2).Using<int, int>((first, second) =>
{
Assert.That(first, Is.EqualTo(second));
return true;
@vcaraulean
vcaraulean / MyExtensions.cs
Last active May 3, 2020 21:30
Capture logging in LINQPad
// Configuring
// Open Query Properties (F4) for My Extensions
// 1. Additional References: add NLog package from nuget
// 2. Additional Namespace Imports: add NLog.Config & NLog
public static class NLogExtensions
{
public static void LogToResults(string loggerName = "*", string minLevel="Trace")
{
var nlogConfig = @"
public class BackgroundServiceOnObservableSchedule : BackgroundService
{
private static readonly ILogger Logger = Log.ForContext<BackgroundServiceOnObservableSchedule>();
private readonly IObservable<Unit> workerSequence;
private IDisposable workerSubscription;
public BackgroundServiceOnObservableSchedule()
{
workerSequence = Observable