For some reason, when passing arguments to the test through TestCaseattrubute, I get the following error message about the first argument, which in this case is an array:
This is not a valid constant expression or custom attribute value.
module GameLogicTest =
open FsUnit
open NUnit.Framework
open GameLogic.Examle
// This is not a valid constant expression or custom attribute value
[<TestCase( [| 1; 2; 3 |], 3, 1,1)>]
let ``let example.`` (a, m, h, c) =
a
|> proof1 m
|> should equal (h,c)
But when deleting the last argument, both from the attribute itself and from the method itself, everything works fine.
[<TestCase( [| 1; 2; 3 |], 3, 1)>]
let ``let example.`` (a, m, h) =
a
|> proof1 m
|> should equal (h,1)
What am I doing wrong? Preferably, I also defined the tuple int * int, but it doesn't work either.
source
share