Skip to content

Instantly share code, notes, and snippets.

View vcaraulean's full-sized avatar

Valeriu Caraulean vcaraulean

View GitHub Profile
@vcaraulean
vcaraulean / Program.cs
Last active July 11, 2016 21:43
Benchmarking NLog's TimeSource implementations
// Required nuget packages:
// - NLog
// - BenchmarkDotNet
namespace BenchmarkNlogTimeSources
{
public class TimeSourceBenchmark
{
private readonly TimeSource _fastLocalTimeSource = new FastLocalTimeSource();
private readonly TimeSource _fastUtcTimeSource = new FastUtcTimeSource();
private readonly TimeSource _accurateLocalTimeSource = new AccurateLocalTimeSource();
@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;
public class BackgroundServiceOnObservableSchedule : BackgroundService
{
private static readonly ILogger Logger = Log.ForContext<BackgroundServiceOnObservableSchedule>();
private readonly IObservable<Unit> workerSequence;
private IDisposable workerSubscription;
public BackgroundServiceOnObservableSchedule()
{
workerSequence = Observable