- Get VS Code
- Remove using NUnit.Framework;
- Add using XUnit;
- Replace all [Test] with [Fact]
- Replace [SetUp] with a constructor
- Replace Assert.That(actualValue, Is.EqualTo(value)); with Assert.Equal(expected, actual)
- highlight Is.EqualTo(
- Delete it
- Select to the end of the line
- Ctrl + X
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
# AWS specific install of Docker | |
sudo yum update -y | |
sudo yum install -y docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user | |
# exit the SSH session, login again | |
# Docker | |
docker run -d --hostname my-rabbit --name some-rabbit -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq |
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
void Main() | |
{ | |
// To run Hastebin in Docker: | |
// docker run --name pastebin -p 801:80 mkodockx/docker-pastebin | |
string baseUrl = "http://localhost:801/"; | |
var hasteBinClient = new HasteBinClient(baseUrl); | |
HasteBinResult result = hasteBinClient.Post("Hello hastebin").Result; | |
if (result.IsSuccess) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Arrange Act Assert</Title> | |
<Author>Chris</Author> | |
<Description>Adds an arrange, act, assert to a test</Description> | |
<HelpUrl /> | |
<Keywords /> | |
<SnippetTypes /> |
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
/// <summary> | |
/// Formats the provided XML so it's indented and humanly-readable. | |
/// </summary> | |
/// <param name="inputXml">The input XML to format.</param> | |
/// <returns></returns> | |
public static string FormatXml(string inputXml) | |
{ | |
XmlDocument document = new XmlDocument(); | |
document.Load(new StringReader(inputXml)); | |
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; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Security.Cryptography.X509Certificates; | |
namespace PublicKeyCryptographyExample | |
{ | |
// | |
// https://yetanotherchris.dev/security/public-private-key-in-netcore-by-example/ | |
// |
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
// | |
// Google Cloud Pub/Sub C# example | |
// NOTE: This is a .NET Core 1.1 console app. | |
// Use "dotnet run" to run it, run setup.ps1 first. | |
// | |
using System; | |
using System.Collections.Generic; | |
using Google.Cloud.PubSub.V1; | |
using Google.Protobuf; |
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 static void Main() | |
{ | |
DoubleLinkedList list = new DoubleLinkedList(); | |
list.Insert("1"); | |
list.Insert("2"); | |
list.Insert("3"); | |
DoubleLink link4 = list.Insert("4"); | |
list.Insert("5"); | |
Console.WriteLine("List: " + list); |
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
/// <summary> | |
/// A basic implementation of a pretty-printer or syntax highlighter for C# soure code. | |
/// </summary> | |
public class SourceColorer | |
{ | |
private string _commentCssClass; | |
private string _keywordCssClass; | |
private string _quotesCssClass; | |
private string _typeCssClass; | |
private bool _addStyleDefinition; |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace SpellingCorrector | |
{ | |
/// <summary> | |
/// Conversion from http://norvig.com/spell-correct.html by C.Small |