Skip to content

Instantly share code, notes, and snippets.

View OsirisTerje's full-sized avatar
💭
Working with NUnit

Terje Sandstrom OsirisTerje

💭
Working with NUnit
View GitHub Profile
dotnet tool install --global dotnet-outdated-tool
@OsirisTerje
OsirisTerje / auth-redirect.interceptor.ts
Created September 10, 2024 10:06
Angular interceptor for redirecting to Fhi.HelseId login
import { HttpErrorResponse, HttpEvent, HttpEventType, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse, HttpStatusCode } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { tap } from 'rxjs/operators';
@Injectable()
export class AuthRedirectInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(req).pipe(tap({
error: (err: any) => {
@OsirisTerje
OsirisTerje / BaseConfigTests.cs
Last active November 30, 2022 17:32
Base class for loading appsettingsconfigurations
using NUnit.Framework;
namespace Fhi.BaseConfigTests;
using System.IO;
using Microsoft.Extensions.Configuration;
public abstract class BaseConfigTests
{
mode: Mainline
branches:
master:
regex: ^master$|^main$|^develop$
ignore:
sha: []
merge-message-formats: {}
root = true
# All files
[*]
indent_style = space
# Xml files
[*.xml]
indent_size = 2
@OsirisTerje
OsirisTerje / History\-115c9aed\entries.json
Created September 8, 2022 18:31
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///d%3A/repos/fhi.itfelles/Fhi.ITDokumentasjon.wiki/Oversikt/Virksomhetsarkitektur.md","entries":[{"id":"pPDo.md","timestamp":1654602975260},{"id":"CjO0.md","timestamp":1654602992511},{"id":"B2n5.md","timestamp":1654603122349},{"id":"8RKf.md","timestamp":1654603134158},{"id":"DjT1.md","source":"moved.source","timestamp":1654603151824}]}
@OsirisTerje
OsirisTerje / killvstest.cmd
Created September 5, 2021 12:17
Cmd script for killing VS Test process including MSBuild - because sometimes these just hang
taskkill /T /F /FI "IMAGENAME eq vstest.*"
taskkill /T /F /FI "IMAGENAME eq TE.Processhost.*"
taskkill /T /F /FI "IMAGENAME eq testhost.*"
taskkill /T /F /FI "IMAGENAME eq MSBuild.*"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="Nuget" value="https://api.nuget.org/v3/index.json" />
<add key="Local" value="c:\nuget" />
</packageSources>
</configuration>
@OsirisTerje
OsirisTerje / NetFrameWork.Legacy.CI.yml
Created November 14, 2019 19:08
Actions yml starter workflow for a .NetFramework build using the legacy project format
name: NetFrameWork.Legacy.CI
on: [push]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
[alias]
a = !git config --get-regexp alias
b = !git switch -c
br = !git switch -c origin/
s = !git status
sw = !git switch
swc = !git switch -c
swd = !git switch --detach
m = !git switch main
p = !git push