考慮我有一個功能,如newConvert
。我被拒絕接受newCovertor("IL")
的錯誤。產生這種erorr:我用failwith "Invalid Input"
F#:UnitTest案例失敗
的erorr是:
System.Exception: Invalid Input
> at FSI_0160.inputChecker(FSharpList`1 numberList) in C:\Users\Salman\Desktop\coursework6input\itt8060-master\coursework6input\BrokenRomanNumbers\Library1.fs:line 140
at FSI_0160.newCovertor(String romanNumber) in C:\Users\Salman\Desktop\coursework6input\itt8060-master\coursework6input\BrokenRomanNumbers\Library1.fs:line 147
at <StartupCode$FSI_0165>[email protected]() in C:\Users\Salman\Desktop\coursework6input\itt8060-master\coursework6input\BrokenRomanNumbers\newtest.fs:line 32
Stopped due to error
我用FsUnit
和Nunit
,它們被加載並安裝和正確地工作。 然後我做了一個測試它使用
[<TestFixture>]
type ``Given a Roman number15 ``()=
[<Test>]
member this.
``Whether the right convert for this number must be exist``()=
newCovertor("IL") |> should equal System.Exception
我不明白!該功能失敗,但測試不接受它,爲什麼??????