【发布时间】:2015-03-02 16:04:02
【问题描述】:
我希望只运行一些单元测试,我已将它们添加到 .fs 文件中。我想在我想运行它们的时候从应用程序入口点调用它们。
这是我写的测试
namespace InvoiceApp
open System
open NUnit.Framework
open FsUnit
module Test =
let testPassed testName = printfn "Test Passed!! - %s" testName
let testFailed testName = printfn "Test Failed!! - %s" testName
[<TestFixture>]
type Test() =
[<TestCase(200,10,20)>]
let ``When profitmarging is 10% and total is 200 expect 20 `` x y z () =
try
Math.percentage x y |> should equal z
testPassed "When profitmarging is 10% and total is 200 expect 20"
with
| :? NUnit.Framework.AssertionException as ex ->
testFailed "When profitmarging is 10% and total is 200 expect 20"
printfn "%s" ex.Message
如何从不同 .fs 文件的入口点调用这些测试?
【问题讨论】: