Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3141493c5c
Fetching contributors…

Cannot retrieve contributors at this time

executable file 24 lines (18 sloc) 0.677 kb
module KoansRunner.Test.KoanResults
open FSharpKoans.Core
open NUnit.Framework
[<Test>]
let ``map lets you project a message when success``() =
let result = Success "sample message"
let mappedResult =
result
|> KoanResult.map (fun x -> x + " expanded")
Assert.AreEqual(Success "sample message expanded", mappedResult)
[<Test>]
let ``map lets you project a message when failure``() =
let ex = new System.Exception("abcd")
let result = Failure ("sample message", ex)
let mappedResult =
result
|> KoanResult.map (fun x -> x + " expanded")
Assert.AreEqual(Failure ("sample message expanded", ex), mappedResult)
Jump to Line
Something went wrong with that request. Please try again.