api文档:http://tool.oschina.net/apidocs/apidoc?api=scalatest-1.7.2

trait Assertions:http://tool.oschina.net/apidocs/apidoc?api=scalatest-1.7.2

traitFunSuite:http://tool.oschina.net/apidocs/apidoc?api=scalatest-1.7.2

请看代码片段一和二的区别:这里有很多规定写法。

代码片段一:是一个测试套,根据名字SetSuite识别。在IDEA中执行的时候,你可以选择执行整个测试套(包含2个用例),或者执行执行测试套的某个用例

package org.scalatest.examples.funsuite

import org.scalatest.FunSuite

class SetSuite extends FunSuite {

  test("An empty Set should have size 0") {
assert(Set.empty.size === 0)
} test("Invoking head on an empty Set should produce NoSuchElementException") {
intercept[NoSuchElementException] {
Set.empty.head
}
}
}

代码片段二:是一个测试用例,根据名字SetTest识别。在IDEA执行的时候,只会执行一个测试用例setTest,测试用例的名字是固定写法

package org.scalatest.examples.funsuite

import org.scalatest.FunSuite

class SetTest extends FunSuite {

  test("setTest") {
assert(Set.empty.size === 0)
} test("setTest1") {
intercept[NoSuchElementException] {
Set.empty.head
}
}
}

参考:

http://orchome.com/246

http://www.scalatest.org/quick_start

https://www.jianshu.com/p/ceabf3437dd7

scala测试框架:scalatest的更多相关文章

  1. [转] ScalaTest测试框架

    [From] https://blog.csdn.net/hany3000/article/details/51033610 ScalaTest测试框架 2016年04月01日 02:49:35 阅读 ...

  2. 契约测试框架-Pact实践

    在前一篇博客中我们讲到契约测试是什么,以及它能给我们软件交付带来什么价值,本次将介绍一个开源的契约测试框架Pact,它最初是用ruby语言实现的,后来被js,C#,java,go,python 等语言 ...

  3. BDD测试框架Spock概要

    前言 为了找到一个适合自己的.更具操作性的.以DDD为核心的开发方法,我最近一直在摸索如何揉合BDD与DDD.围绕这个目标,我找到了Impact Mapping → Cucumber → Spock ...

  4. phpunit 测试框架安装

    PHPUnit是一个轻量级的PHP测试框架.它是在PHP5下面对JUnit3系列版本的完整移植,是xUnit测试框架家族的一员(它们都基于模式先锋Kent Beck的设计).来自百度百科 一.下载wg ...

  5. 某互联网后台自动化组合测试框架RF+Sikuli+Python脚本

    某互联网后台自动化组合测试框架RF+Sikuli+Python脚本 http://www.jianshu.com/p/b3e204c8651a 字数949 阅读323 评论1 喜欢0 一.**Robo ...

  6. selenium测试框架使用xml作为对象库

    之前已经写过一篇: selenium测试框架篇,页面对象和元素对象的管理 上次使用的excel作为Locator对象管理,由于excel处理不够方便,有以下缺点: 不能实现分page 加载Locato ...

  7. selenium 测试框架中使用grid

    之前的测试框架:http://www.cnblogs.com/tobecrazy/p/4553444.html 配合Jenkins可持续集成:http://www.cnblogs.com/tobecr ...

  8. selenium测试框架篇,页面对象和元素对象的管理

    前期已经做好使用Jenkins做buildhttp://www.cnblogs.com/tobecrazy/p/4529399.html 做自动化框架,不可避免的就是对象库. 有一个好的对象库,可以让 ...

  9. Junit测试框架 Tips

    关于Junit测试框架使用的几点总结: 1.Junit中的测试注解: @Test →每个测试方法前都需要添加该注解,这样才能使你的测试方法交给Junit去执行. @Before →在每个测试方法执行前 ...

随机推荐

  1. POJ 2983-Is the Information Reliable

    Description The galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years a ...

  2. 《c程序设计语言》读书笔记-第二个字符串任意一个在第一个字符串出现的位置,未出先返回-1

    #include <stdio.h> #include <string.h> #define Num 1000 int main() { int c,i,j = 0,m = 0 ...

  3. poj 3678 Katu Puzzle 2-SAT 建图入门

    Description Katu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a ...

  4. HDU2041 简单DP+规律

    超级楼梯 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...

  5. root权限

    点击左侧终端标 步骤阅读 2 出现命令提示符 3 首先输入:sudo passwd root(设置root密码) 4 输入当前系统的账户密码(账户:admin-pc的密码) 5 输入新的root密码, ...

  6. 使用vim进行java编程

    首先:编写源代码Test.java 1class Test{                                                                       ...

  7. linux 内核库函数 【转】

    转自:http://blog.chinaunix.net/uid-20321537-id-1966892.html 当编写驱动程序时,一般情况下不能使用C标准库的函数.Linux内核也提供了与标准库函 ...

  8. Appium+python自动化17-启动iOS模拟器APP源码案例【转载】

    前言 上一篇已经可以启动iOS模拟器上的safari浏览器了,启动app比启动浏览器要复杂一点,本篇以github上的源码为案例详细介绍如何启动iOS模拟器的app 一.clone源码 1.githu ...

  9. git 本地与远程关联流程

    git init git add -A git commit -m '提交' git remote add origin git@github.com:laniu/liuna.git git push ...

  10. 关于JAVA SESSION的小测试

    手生就要多练啊... package com.jeelearning.servlet; import java.io.IOException; import java.io.PrintWriter; ...