FIT FOR DOT NET (6)----RowFixture
来源:互联网 发布:淘宝上破解软件 靠谱吗 编辑:程序博客网 时间:2024/05/22 03:27
对于ColumnFixture,我认为比较复杂,所以我用的不太多,在这里我把它的理解说一下,其中很多观点来源于其网站.
Row Fixture
RowFixture将测试数据的行和测试下系统的对象作比较,方法在对象以及与表数据比较的返回值上调用,一个算法符合带有基于一个或者多个键对象的行.对象可以遗漏,也可多余,这些都是需要注意的.
下面的Q&A来自其网站:
Q: RowFixture.match is kind of hard to understand. Obviously I did not know anything about it but some more info on its matching algorithm on its wiki page might help the novice reader like me. Do you think that it could be refactored to help the common brains like mine grok it?
A: RowFixture was very hard to get right until I found the current factoring. The algorithm is a variation on the bucket sort where two parallel sorts are taking place, one of the expected rows and another for the computed rows.
- http://www.nist.gov/dads ... /bucketsort.html
The fixture processes all the rows of one table following these five steps:
- bind the columns to variables and methods by reflection.
- query to get the result rows which will be checked.
- match the expected and result rows and check the matches.
- build html for missing rows.
- mark mark missing and surplus rows as such.
Of these steps the match is the most complex. The matching algorithm is one of divide and conquer using a method that calls itself recursively in two circumstances:
- recurse matching subsets of the expected and computed rows distinguished by unique values in a specific column.
- recurse so as to examine the next available column when the current column doesn't successfuly bind to any field or method.
Each invocation of the method divides the expected and computed rows into sublists with equal values in the current column of interest. (This is the "sort" step, as in sorting clothes into like piles.) Each sublist (pile) is considered in turn. There are four cases:
- the expected list is empty so computed rows are surplus.
- the computed list is empty so expected rows are missing.
- there is exactly one row in each list so compare them.
- otherwise the match is ambiguous so further sorting on subsequent columns is required.
The method uses several helper functions which are sometimes duplicated because of representational differences between the expected rows (Parse objects) and the computed rows (Domain objects).
- FIT FOR DOT NET (6)----RowFixture
- FIT For Dot NET
- FIT FOR Dot NET(1)
- FIT FOR DOT NET(2)----
- FIT FOR Dot NET (3)
- FIT FOR DOT NET(4)
- FIT FOR DOT NET(5)---ColumnFixture
- FIT For .NET
- sina-open-api-for-dot-net-40-sdk
- transaction in dot net
- Dot Net 工具介绍
- dot net tool URL
- Dot Net 自述
- Dot.net安全机制
- dot net 必备工具
- Dot Net好书推荐
- 关于dot net 报表
- dot net 编程
- FIT FOR DOT NET(5)---ColumnFixture
- 第一次亲密接触
- 怎么办呢?
- 转贴好词一首
- MTL 向量欧基里德范数 示例
- FIT FOR DOT NET (6)----RowFixture
- g++ 3.4.3
- 使用 OSGi 作为软件产品框架
- 想通过vbscript将所有电脑的tcp/ip设定导入文件进行检视,怎么做到?
- 关于java异常处理机制的深入理解
- 修炼一名程序员的职业水准(林庆忠__署名原创)
- 漫谈软件性能测试技术
- 面试技巧:16个经典面试问题回答思路
- OC 3 12 48