-
-
Notifications
You must be signed in to change notification settings - Fork 108
Added more f# tests #2427
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
Added more f# tests #2427
Conversation
|
So far a couple of potential issues.
Update
|
|
Assertions that Throw
[<Test>]
[<Category("Fail")>]
member _.Throws1() = async {
do! check (Assert.That<Func<string>>(fun () -> new string([||])).ThrowsException())
}
[<Test>]
[<Category("Fail")>]
member _.Throws2() = async {
do! check (Assert.That(fun () -> task { do! Task.Yield() }).ThrowsException())
}
[<Test>]
[<Category("Pass")>]
member _.Throws3() = async {
do! check (Assert.That(fun () -> raise (ApplicationException())).ThrowsException())
} |
|
Annoying that F# doesn't pick up things as nicely! |
Yeah, unlike VB, F# uses a completely different compiler and has a bunch of functional paradigms that don't really carry over. Unlike VB, VB is basically older OOP so for the most part it works with the C# stuff. Although we will find out when I make more VB tests 🤣. I will say, though, apart from a few things, F# has surprisingly picked up most of the C# stuff fine, considering they use two different compilers and paradigms |
Fixed in #2431 Example assertion usage [<Test>]
[<Category("Fail")>]
member _.Throws1() = async {
do! check (Assert.That<string>(fun () -> task { return new string([||]) }).ThrowsException())
}
[<Test>]
[<Category("Fail")>]
member _.Throws2() = async {
do! check (Assert.That<unit>(fun () -> task { do! Task.Yield() }).ThrowsException())
}
[<Test>]
[<Category("Pass")>]
member _.Throws3() = async {
do! check (Assert.That(fun () -> raise (ApplicationException())).ThrowsException())
} |
|
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR was closed because it has been stalled for 10 days with no activity. |

This PR will add more Tests to the Example project. This is to ensure all Assertions and Attributes work correctly in F#