本文整理汇总了C#中TechSmith.Hyde.Test.SimpleDataItem.ComesBefore方法的典型用法代码示例。如果您正苦于以下问题:C# SimpleDataItem.ComesBefore方法的具体用法?C# SimpleDataItem.ComesBefore怎么用?C# SimpleDataItem.ComesBefore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TechSmith.Hyde.Test.SimpleDataItem
的用法示例。
在下文中一共展示了SimpleDataItem.ComesBefore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCollection_ManyItemsInStore_ShouldBeRetreivedInProperSortedOrder
public void GetCollection_ManyItemsInStore_ShouldBeRetreivedInProperSortedOrder()
{
var dataItem1 = new SimpleDataItem { FirstType = "a", SecondType = 1 };
var dataItem2 = new SimpleDataItem { FirstType = "b", SecondType = 2 };
var dataItem3 = new SimpleDataItem { FirstType = "c", SecondType = 3 };
var dataItem4 = new SimpleDataItem { FirstType = "d", SecondType = 4 };
_tableStorageProvider.Add( _tableName, dataItem1, _partitionKey, "3" );
_tableStorageProvider.Add( _tableName, dataItem2, _partitionKey, "2" );
_tableStorageProvider.Add( _tableName, dataItem3, _partitionKey, "1" );
_tableStorageProvider.Add( _tableName, dataItem4, _partitionKey, "4" );
_tableStorageProvider.Save();
var listOfItems = _tableStorageProvider.GetCollection<SimpleDataItem>( _tableName, _partitionKey ).ToArray();
Assert.IsTrue( dataItem3.ComesBefore( listOfItems, dataItem1 ), "Making sure item 3 comes before item 1." );
Assert.IsTrue( dataItem3.ComesBefore( listOfItems, dataItem2 ), "Making sure item 3 comes before item 2." );
Assert.IsTrue( dataItem3.ComesBefore( listOfItems, dataItem4 ), "Making sure item 3 comes before item 4." );
Assert.IsTrue( dataItem2.ComesBefore( listOfItems, dataItem1 ), "Making sure item 2 comes before item 1." );
Assert.IsTrue( dataItem2.ComesBefore( listOfItems, dataItem4 ), "Making sure item 2 comes before item 4." );
Assert.IsTrue( dataItem1.ComesBefore( listOfItems, dataItem4 ), "Making sure item 1 comes before item 4." );
}