This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
open FSharp.Data | |
open System | |
open System.Net | |
open Xunit | |
let verify = Swensen.Unquote.Assertions.test | |
[<Fact>] | |
[<UseImposterStub( | |
"192.168.1.4", |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Custom matchers for Expressions</title> | |
<!-- $ bower install jasmine && npm install jsep --> | |
<link href="bower_components/jasmine/lib/jasmine-core/jasmine.css" rel="stylesheet" /> | |
<script src="bower_components/jasmine/lib/jasmine-core/jasmine.js"></script> |