Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hardcoded lines test
  • Loading branch information
theimowski committed May 5, 2015
commit a173a1b1d70d0d00279da21cacc6b510f6c1db43
20 changes: 18 additions & 2 deletions tests/Paket.Tests/DependenciesFile/PropertyTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,29 @@ open FsCheck
open FsCheck.NUnit
open Paket

let source = Gen.constant "source https://nuget.org/api/v2"

let nuget = Gen.constant "nuget FsCheck"

let github = Gen.constant "github forki/FsUnit FsUnit.fs"

let gist = Gen.constant "gist Thorium/1972349 timestamp.fs"

let http = Gen.constant "http http://www.fssnip.net/1n decrypt.fs"

let depLine = Gen.oneof [source; nuget; github; gist; http]

type DFFileGenerator =
static member StringArray() =
{new Arbitrary<string[]>() with
override x.Generator = Gen.elements [[|"nuget FsCheck"|]]
override x.Generator = Gen.arrayOf depLine
override x.Shrinker t = Seq.empty }

[<Property(Arbitrary = [|typeof<DFFileGenerator>|])>]
let _ = PropertyAttribute(Verbose = true)

[<Property(
Arbitrary = [|typeof<DFFileGenerator>|],
Verbose = true)>]
let ``round trip`` (lines : string[]) =
let df = DependenciesFile(DependenciesFileParser.parseDependenciesFile "dummy" lines)
df.ToString() = String.concat Environment.NewLine lines