You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeNaturalNumberSeqTest(output: ITestOutputHelper)=letnats= TheoryData(seq{0..4})[<Theory; MemberData(nameof nats)>]let``Natural number sequence``(i:int)=letexpect=[0;1;2;3]letactual=[0;1;2;3]
Should.equal expect.[i] actual.[i]
(The fact that your example is a bit contrived gives away the fact that this is not your true requirement, but my general contention that having lots of generation helpers like this becomes very messy remains)
@bartelink's answer is a reasonable solution here.
Additionally, for re-usability you can create your own data sources by creating an attribute that derives from DataAttribute. Sample (utilizing TheoryData) in C#:
Natural number sequence Theory is the simplest form of testing our theory with data.
Currently, I use the
InlineDataAttribute
attribute to represent array indicesFeature request: same code using
NaturalAttribute
attributeThe text was updated successfully, but these errors were encountered: