【发布时间】:2009-03-30 21:40:28
【问题描述】:
我有一个自定义的数据收集类型。该数据按三个属性按顺序排序,例如举个例子:
class Data
{
public int PropertyA() { get; set; }
public int PropertyB() { get; set; }
public int PropertyC() { get; set; }
}
集合必须保持A、B、C的顺序,例如:
[A, B, C]
[1, 2, 5]
[1, 3, 3]
[1, 3, 4]
[1, 4, 1]
[2, 1, 2]
[3, 3, 1]
[3, 4, 2]
我想编写一些测试,以确保通过通常的可疑添加和删除操作在集合中保持此顺序。我正在使用 Gallio 和 MbUnit 3,我认为必须有一种简单的方法来使用它们的属性来做到这一点,我只是现在不明白。有什么想法吗?
【问题讨论】:
标签: c# unit-testing sorting collections mbunit