0

你能帮我解决我的问题吗?

我正在做一个项目。对于测试,我使用 MSpec。是否可以分组测试。因此,当我运行测试运行程序时,它们应该按组进行测试,即以正确的方式:

1)注册用户时,我提供不同的密码和确认密码

  • 应该返回错误信息

2) 注册用户时,我提供所有需要的信息 » 用户应该注册 » 用户应该被重定向到主页

3)获取标签树时,我得到标签树

  • 我们应该看到标签树

但就我而言,它的工作方式如下:

1)注册用户时,我提供不同的密码和确认密码

  • 应该返回错误信息

3)获取标签树时,我得到标签树

  • 我们应该看到标签树

2) 注册用户时,我提供所有需要的信息

  • 用户应该注册
  • 用户应该被重定向到主页
4

1 回答 1

2

现在唯一对上下文进行分组的地方是在 HTML 报告中。您需要使用该[Subject]属性并为需要分组的上下文提供相同的文本或类型名称。

在不相关的说明中,我会以不同的方式命名您的上下文/规范:

User registration, When providing different password and confirmation password
  » should display an error message

User registration, When providing all information needed (What's "all" information?)
  » should register the user
  » should redirect to the home page

Tags tree, When getting the tags tree
  » should display the tags tree
于 2011-03-12T14:37:50.687 回答