mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-10-08 21:48:40 +00:00
22 lines
666 B
Forth
22 lines
666 B
Forth
namespace WoofWare.Myriad.Plugins.Test
|
|
|
|
open FsUnitTyped
|
|
open NUnit.Framework
|
|
open ConsumePlugin.ArgsWithUnions
|
|
|
|
[<TestFixture>]
|
|
module TestArgsWithUnions =
|
|
|
|
let argsWithUnionsCases =
|
|
[
|
|
["--token" ; "hello" ; "--foo" ; "3" ; "--bar=hi" ; "--baz"], { Auth = AuthOptions.Token { Token = "hello" } ; Basics = { Foo = 3 ; Bar = "hi" ; Baz = true ; Rest = [] } }
|
|
]
|
|
|> List.map TestCaseData
|
|
|
|
[<TestCaseSource (nameof argsWithUnionsCases)>]
|
|
let ``foo`` (args : string list, expected : DoTheThing) : unit =
|
|
args
|
|
|> DoTheThing.parse' (fun _ -> failwith "didn't expect env var")
|
|
|> shouldEqual expected
|
|
|