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
module Scenarios | |
open Ploeh.AutoFixture | |
open Ploeh.AutoFixture.Kernel | |
open Ploeh.Albedo | |
open Ploeh.Albedo.Refraction | |
open System | |
type TextEndsWithConvention(value, found) = | |
inherit ReflectionVisitor<bool>() |
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
// F# port of @ploeh's answer at http://stackoverflow.com/a/20723447/467754 for ASP.NET Web API 2. | |
type WebApiCustomization() = | |
interface ICustomization with | |
member this.Customize fixture = | |
fixture.Customize<HttpConfiguration>(fun c -> | |
c.OmitAutoProperties() :> ISpecimenBuilder) | |
fixture.Customize<HttpRequestMessage>(fun c -> | |
c.Do(fun (x : HttpRequestMessage) -> | |
x.Properties.[HttpPropertyKeys.HttpConfigurationKey] <- |
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 interface IInterface | |
{ | |
object MakeIt(object obj); | |
} | |
public abstract class AbstractTypeWithNonDefaultConstructor<T> | |
{ | |
private readonly T property; | |
protected AbstractTypeWithNonDefaultConstructor(T value) |
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
diff --git a/BookingApi/DomainModel.fs b/BookingApi/DomainModel.fs | |
index 4a4260f..c2079cf 100644 | |
--- a/BookingApi/DomainModel.fs | |
+++ b/BookingApi/DomainModel.fs | |
@@ -7,6 +7,23 @@ type Period = | |
| Month of int * int | |
| Day of int * int * int | |
+[<AutoOpen>] | |
+module Drain = |
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
namespace ReturnValueMustNotBeNullAssertionScenarios | |
open FsCheck | |
open Ploeh.AutoFixture.Idioms.FsCheck | |
open Ploeh.AutoFixture.Kernel | |
open Ploeh.AutoFixture.Xunit | |
open System | |
open Xunit.Extensions | |
type Generators = |
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
let verify = Swensen.Unquote.Assertions.test | |
[<FirstClassTests>] | |
let ``Diamond is as wide as it's high`` () = | |
seq {'A' .. 'Z'} | |
|> Seq.map (fun letter -> TestCase (fun () -> | |
let actual = Diamond.make letter | |
let rows = split actual | |
let expected = rows.Length |
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
type OddlySpelledWords = | |
static member String() = | |
["zZ"; "oO0Ò"; "eEê"] | |
|> List.map Gen.elements | |
|> Gen.sequence | |
|> Gen.map (List.map string >> List.reduce (+)) | |
|> Arb.fromGen | |
[<Property(Arbitrary = [| typeof<OddlySpelledWords> |])>] | |
let ``Generate oddly spelled words`` s = |
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
// Port of Haskell | |
// - https://hackage.haskell.org/package/QuickCheck-1.2.0.1 | |
// - https://hackage.haskell.org/package/random-1.1 | |
namespace LightCheck | |
/// <summary> | |
/// This module deals with the common task of pseudo-random number generation. | |
/// It makes it possible to generate repeatable results, by starting with a | |
/// specified initial random number generator, or to get different results on |
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
name: Booking | |
version: 0.1.0.0 | |
synopsis: Handling a reservation request in Haskell. Proof of concept | |
description: Please see README.md | |
homepage: https://gist.github.com/ploeh/c999e2ae2248bd44d775 | |
license: MIT | |
license-file: LICENSE | |
author: Mark Seemann | |
maintainer: example@example.com | |
copyright: 2016 Mark Seemann |
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
# Last checked | |
# $ date | |
# Mon Feb 27 23:59:15 EEST 2017 | |
2017-02-17 https://fsharpforfunandprofit.com/cap/ | |
2017-02-17 https://fsharpforfunandprofit.com/turtle/ | |
2017-02-17 https://fsharpforfunandprofit.com/video/ | |
2016-12-05 https://fsharpforfunandprofit.com/posts/dependency-injection-1 | |
2016-08-01 https://fsharpforfunandprofit.com/installing-and-using/ | |
2016-06-23 https://fsharpforfunandprofit.com/parser/ |