本文整理匯總了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." );
}