Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

Scott Sauber scottsauber

:shipit:
View GitHub Profile
View .bashrc
# create new PR and open it
function pr() {
github_url=`git remote -v | awk '/fetch/{print $2}' | sed -Ee 's#(git@|git://)#https://#' -e 's@com:@com/@' -e 's%\.git$%%' | awk '/github/'`;
branch_name=`git symbolic-ref HEAD | cut -d"/" -f 3,4`;
main_branch=`git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4`
open_or_start='open'
uname=$(uname)
if [[ "$uname" == CYGWIN* || "$uname" == MINGW* ]] ; then
open_or_start='start'
fi
View Program.cs
builder.Services.AddScoped<IRegisterAccountService, RegisterAccountService>();
builder.Services.AddScoped<IRazorViewToStringRenderer, RazorViewToStringRenderer>();
View RegisterAccountService.cs
using MailKit.Net.Smtp;
using MimeKit;
using MimeKit.Text;
using RazorHtmlEmails.RazorClassLib.Services;
using RazorHtmlEmails.RazorClassLib.Views.Emails.ConfirmAccount;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace RazorHtmlEmails.Common;
View CalculatorServiceTests.cs
[Fact]
public void AddShouldSumNumbers()
{
var result = CalculatorService.Add(1, 1);
result.Should().Be(3);
}
View CalculatorServiceTests.cs
[Fact]
public void AddShouldSumNumbers()
{
var result = CalculatorService.Add(1, 1);
Assert.Equal(3, result);
}
View CalculatorServiceTests.cs
[Fact]
public void AddShouldSumNumbers()
{
var result = CalculatorService.Add(1, 1);
Assert.True(result == 3);
}
View WorkerService.csproj
<Project Sdk="Microsoft.NET.Sdk.Worker">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
View CounterTests.cs
public class CounterTests : TestContext
{
[Fact]
public void ShouldIncrementCountWhenButtonIsClicked()
{
var counterComponent = RenderComponent<Counter>();
counterComponent.Find("button").Click();
// Asserts actual user behavior