|> ignore is required here, since the signature of TestMethod1 is deduced from the inside out. Note that in C #, the return type of the method is required in the method declaration. These are deep differences between languages.
"Free" APIs are a nuisance in F #, because they include instance methods that have an effect and return a value, the red flag in F #. That is, although side effects are allowed in F #, they are quarantined somewhat, both in the language specification and by convention. It is expected that the method returning unit has an effect, but, on the contrary, it is expected that the method returning non-unit value will be clean.
In addition, fluent APIs seek to solve restrictions in languages ββsuch as C #, which F # does not have or decides otherwise. For example, in F #, the pipe operator + immutable data structure transformations is comparable to a white API in an imperative language.
Try using a more idiomatic F # module test approval library such as Unquote (disclaimer, I'm the author). It uses many of F #'s strengths in the same way FluentAssertions tries to make up for C #'s flaws.
source share