Empty file to get a better name for the gist
View Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Amazon.SQS; | |
var builder = WebApplication.CreateBuilder(args); | |
builder.Configuration.AddInMemoryCollection(new Dictionary<string, string> { | |
["AWS:Profile"] = "LocalStack", | |
["AWS:Region"] = "us-east-1" | |
}); | |
var options = builder.Configuration.GetAWSOptions(); |
View Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.CommandLine; | |
using Amazon; | |
using Amazon.S3; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
var profileOption = new Option<string>("--profile", getDefaultValue: () => "default", description: "The name of the profile to use to access AWS services."); | |
var regionOption = new Option<string>("--region", getDefaultValue: () => RegionEndpoint.EUWest1.SystemName, description: "The region where AWS services are located."); |
View unit-test-lifecycle.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using NUnit.Framework; | |
[SetUpFixture] | |
public class RootFixtureSetup | |
{ | |
[OneTimeSetUp] | |
public void OneTimeSetUp() => Debug.WriteLine("RootFixtureSetup:OneTimeSetUp"); | |
[OneTimeTearDown] |
View FizBuz.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enumerable.Range(1, 100) | |
.Select(CheckModulo) | |
.Select(FizBuz) | |
.ToList() | |
.ForEach(Console.WriteLine); | |
static (bool isFizz, bool isBuzz, int n) CheckModulo(int n) | |
{ | |
return (n % 3 == 0, n % 5 == 0, n); | |
} |
View SmartAutoDataAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SmartAutoDataAttribute : AutoDataAttribute | |
{ | |
public SmartAutoDataAttribute() : base(() => CreateFixture(null)) { } | |
public SmartAutoDataAttribute(Type type, string methodName) : base(CreateFixtureWithMethod(type, methodName)) { } | |
private static Func<IFixture> CreateFixtureWithMethod(Type type, string methodName) | |
{ | |
if (type == null) | |
{ |
View QueueSubject.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class QueueSubject<T> : ISubject<T> | |
{ | |
private readonly Subject<T> _subject = new Subject<T>(); | |
private readonly Queue<Action<IObserver<T>>> _actions = new Queue<Action<IObserver<T>>>(); | |
private bool _isCompleted = false; | |
private Exception _error; | |
public bool IsRunning => !_isCompleted && _error == null; | |
public bool HasObservers => _refCount > 0; |
View AutoMoqError.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp2.0</TargetFramework> | |
<IsPackable>false</IsPackable> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="AutoFixture" Version="4.6.0" /> |
View thats-me.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bio: | |
Born in Napoli, Italy, living in Stockholm, Sweden. Passionate about distributed software architecture and .NET. Proud owner of a Windows 10 Mobile. | |
URL: | |
http://www.educationsmediagroup.com/ | |
Company: | |
CTO at Educations Media Group ( @emgdev ) | |
Location: |
View docker-info.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Renato> docker info | |
Containers: 2 | |
Running: 0 | |
Paused: 0 | |
Stopped: 2 | |
Images: 2 | |
Server Version: 18.03.1-ce | |
Storage Driver: lcow (linux) windowsfilter (windows) | |
LCOW: | |
Windows: |
NewerOlder