Skip to content

Instantly share code, notes, and snippets.

View ursenzler's full-sized avatar

Urs Enzler ursenzler

View GitHub Profile
@ursenzler
ursenzler / Simple value factory function
Created September 26, 2023 07:08
A function in F# that can create dummy strings and integers (can be extended).
open FsToolkit.ErrorHandling
open Xunit
open Swensen.Unquote
let factoryFunction<'a> () : 'a =
let value =
if typeof<'a> = typeof<string> then "String" :> obj
elif typeof<'a> = typeof<int> then 1 :> obj
else failwith "Unsupported type"
downcast value
@ursenzler
ursenzler / FsharpFluentAssertionsExtensions
Created February 11, 2021 12:47
Our wrappers around FluentAssertions to make them simpler to use from F# code.
[<AutoOpen>]
module FluentAssertionsExtensionMethods
open System
open System.Collections
open System.Runtime.CompilerServices
open FluentAssertions
open FluentAssertions.Collections
open FluentAssertions.Equivalency
open FluentAssertions.Numeric
@ursenzler
ursenzler / SemaphoreUsage.cs
Last active May 1, 2018 09:01 — forked from danielmarbach/Usage.cs
Simple Semaphore Usage
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Semaphore
{
class Program
{
static void Main(string[] args)
{

Fake It Easy Specs

Asserting On Set Only Properties

Set Only Properties

  • establish
  • when assertion on set only properties
@ursenzler
ursenzler / SetupAppccelerateUrsEnzler.ps1
Created December 2, 2014 10:03
Setup PS to work with my forks of Appccelerate repositories
cd C:\Projects\appccelerate\ursenzler_repos
Import-Module C:\projects\appccelerate\ursenzler_repos\scripts\Appccelerate.ps1 -DisableNameChecking
@ursenzler
ursenzler / SetupAppccelerateMain.ps1
Created December 2, 2014 10:02
Setup PS for working with Appccelerate main repositories
cd C:\Projects\appccelerate\repos
Import-Module C:\projects\appccelerate\repos\scripts\Appccelerate.ps1 -DisableNameChecking
@ursenzler
ursenzler / nuget_update
Created April 8, 2014 07:00
executes nuget update on all Appccelrate repos
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
cd $scriptPath
$solutions = Get-ChildItem $scriptPath -Recurse -Filter *.sln
foreach($solution in $solutions)
{
write-host $solution.FullName
$packagesFolder = (Split-Path -parent $solution.FullName) + "\packages"
@ursenzler
ursenzler / git_pull
Created April 8, 2014 06:59
executes git pull on all Appccelerate repos
. .\ExecuteOnRepos.ps1
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
cd $scriptPath
ExecuteOnRepos $scriptPath "git" "pull"
@ursenzler
ursenzler / ExecuteOnRepos
Created April 8, 2014 06:58
executes a command on all Appccelerate repos
function ExecuteOnRepos([string]$reposPath, [string]$command, [string]$arguments)
{
$folders = Get-ChildItem $reposPath | ?{ $_.PSIsContainer } | Select-Object FullName
foreach($folder in $folders)
{
cd $folder.FullName
$gitFolder = $folder.FullName + "\.git"
if (Test-Path $gitFolder)
{
@ursenzler
ursenzler / gist:3103750
Created July 13, 2012 08:53
Prototype of Appccelerate feature management
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FreakyFeatureManagement
{
using Appccelerate.EvaluationEngine;
class Program