-
-
Couldn't load subscription status.
- Fork 94
Adding F# and VB.NET Basic templates #2386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
A couple of challenges so far. Both VB and F# F#
[<Test>]
[<Arguments(1, 2, 3)>]
[<Arguments(2, 3, 5)>]
member _.DataDrivenArguments(a: int, b: int, c: int): Task =
task {
Console.WriteLine("This one can accept arguments from an attribute")
let result = a + b
// Properly await the assertion`
let assertion = Assert.That(result).IsEqualTo(c)
let awaiter = (assertion :> InvokableValueAssertionBuilder<int>).GetAwaiter()
awaiter.GetResult() |> ignore
} |
b3cc4d4 to
ee7278f
Compare
|
Thanks @licon4812 ! I've spent this evening looking at the FSharp assertions. First time really using F# and I'm not enjoying it haha. But I think I've figured out a custom operator to "await" the assertion in F#.
Back to being a one-liner, and I think it still reads okay. What do you think? |
I like that syntax. Simple to see and does allow us to use async instead of a task. Just a shame F# requires us to return or use something for it to not be ignored. Definetly way better than what I had to do in the template |
|
@thomhurst I tried having a crack at making a non-generic implementation of ClassDataSourceAttribute. I didn't have much luck due to trimmer warnings |
That's next on my list to try and sort 😄 probably won't get a chance until Sunday now though |
|
Updated the F# assertions in the template to utilize the new library provided in #2388 |
|
Pushing out a version as we speak with non-generic attributes which should unblock F# and VB 😄 |
Thanks @thomhurst That worked well in both VB and F#. Something else has come up now 😞 F# VB When I control-click on the attribute in VS, it takes me to this abstract constructor |
|
I saw something similar. But it built fine. Maybe restart your ide? |
|
Just making some template tests now |
|
should be ready to go @thomhurst |
This is due to package not automatically being resolved
|
I had to add a specific package reference to FSharp Template for FSharpAssertions <PackageReference Include="TUnit.Assertions.FSharp" Version="0.21.1" /> This is due to the dotnet cli being unable to resolve it from the main TUnit package on build or restore. It worked perfectly fine in VS just not in the cli |





This PR will allow people to create the TUnit project in either VB.NET or F#.