About
- Linkdump for the code katas workshop by quality @ speed and ae.
//https://fsprojects.github.io/SwaggerProvider/#/ | |
(* | |
#r "nuget: SwaggerProvider, Version=2.0.0-beta9" | |
*) | |
open SwaggerProvider | |
open System | |
open System.Net.Http | |
type PetStore = OpenApiClientProvider<"https://petstore3.swagger.io/api/v3/openapi.json"> |
//Inspired on "How to specify it!" by John Hughes (& Java adaptation by Johannes Link) | |
//https://johanneslink.net/how-to-specify-it/ | |
#r "nuget: fscheck" | |
open FsCheck | |
module BST = | |
type BinarySearchTree<'v> = | |
| Empty | |
| Node of |
#r "nuget: FsCheck, version=3.0.0-beta1" | |
open FsCheck | |
open FsCheck.FSharp | |
let revRev xs = xs |> List.rev |> List.rev = xs | |
Check.QuickThrowOnFailure revRev | |
type Tree<'a> = Branch of Tree<'a> * Tree<'a> | Leaf of 'a |
using System.Threading.Tasks; | |
using LanguageExt; | |
using Xunit; | |
namespace LanguageExtDemo | |
{ | |
public class Repository | |
{ | |
public OptionAsync<string> GetName(int id) |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using FluentAssertions; | |
using Xunit; | |
using LanguageExt; | |
using static LanguageExt.Prelude; | |
namespace LanguageExtDemo | |
{ |
#r @"C:\Code\SharpVG\SharpVG\bin\Debug\netstandard2.1\SharpVG.dll" | |
#r @"C:\NugetLocal\netstandard\build\net461\lib\netstandard.dll" | |
open SharpVG | |
let black = Color.ofName Black | |
let opaque = 1.0 | |
let style = Style.create black black Length.one opaque opaque | |
let lineAt p1 p2 = Line.create (Point.ofInts p1) (Point.ofInts p2) |> Element.create |> Element.withStyle style |
#r @"C:\NugetLocal\FsCheck.2.4.0\lib\net45\FsCheck.dll" | |
open FsCheck | |
//Simple property | |
let reversingAReversedList l = List.rev (List.rev l) = l | |
Check.Quick reversingAReversedList | |
//Failing property: example of standard shrinking | |
let reversingAList l = (List.rev l) = l | |
Check.Quick reversingAList |
%load a prolog file like [this]. | |
%or just send file to REPL | |
%Peano arithmetic | |
% https://en.wikipedia.org/wiki/Peano_axioms | |
% * 0 is a natural number | |
% * if n is a natural number, s(n) is a natural number | |
% * equality | |
% * 0 = 0 | |
% * a = b -> s(a) = s(b) |
[TestClass] | |
public class WhenTargetContractDoesNotCorrespondToSourceContractOtherFirmnessLevel : GivenRulesDeterminedFromDatabaseConfiguredRules | |
{ | |
private ICapacityConversionRequest capacityConversionRequest; | |
private IRepository<ITransmissionService> transmissionServiceRepository; | |
private void GivenParameters() | |
{ | |
this.capacityConversionRequest = MockRepository.GenerateStub<ICapacityConversionRequest>(); |