单元测试 Scala [英] Unit testing Scala

查看:44
本文介绍了单元测试 Scala的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近才开始学习 Scala 语言,并希望在 TDD 中学习-办法.您能否分享您在 Scala 的单元测试框架方面的经验以及它们的优缺点.

I just recently started learning the Scala language and would like to do it in TDD-way. Could you share your experiences on the unit testing frameworks there are for Scala and the pros/cons of them.

我使用 IntelliJ IDEA 进行 Scala 开发,因此能够在 IDE 支持下运行测试会很好.

I'm using IntelliJ IDEA for Scala development, so it would be nice to be able to run the tests with IDE-support.

推荐答案

你看过 ScalaTest?

我没用过它,但它来自 Artima 的 Bill Venners 和 co,因此我怀疑它可以完成这项工作.然而,它似乎没有集成 IDE.

I've not used it, but it comes from Bill Venners and co at Artima, and consequently I suspect it'll do the job. It doesn't appear to have IDE integration, however.

这篇博文有点旧,但建议 TestNG是测试 Scala 的最佳选择.TestNG 肯定会集成 IDE.

This blog entry is a little old, but suggests that TestNG is the best option for testing Scala. TestNG will certainly have IDE integrations.

我刚刚意识到我在 2009 年写了这个答案,世界已经在前进(!).我目前正在使用 ScalaTest,IDE 集成工作正常,我强烈推荐它.特别是 matcher DSL 工作得非常好

I've just realised that I wrote this answer in 2009, and the world has moved on (!). I am currently using ScalaTest, the IDE integration works fine, and I can strongly recommend it. In particular the matcher DSL works very nicely

这篇关于单元测试 Scala的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆