IsOrdered() public static method

Assert that an array, list or other collection is ordered
public static IsOrdered ( IEnumerable collection ) : void
collection IEnumerable An array, list or other collection implementing IEnumerable
return void
コード例 #1
0
        public void SortingByName()
        {
            //arrange
            _driver.Url = _urlForSorting;
            var sortingOnCoreFilteringContext = new SortingOnCoreFilteringContext(_driver);
            var sortingResultContext          = new SortingResultContext(_driver);


            //act
            sortingOnCoreFilteringContext.SelectSortingByName();
            var actualResult = sortingResultContext.GetSortingResultByName();

            //assert
            CollectionAssert.IsOrdered(actualResult, "The sorting result should be in alphabetical order.");
        }
コード例 #2
0
        public void PriceSortingIncrease()
        {
            //arrange
            _driver.Url = _urlForSorting;
            var sortingOnCoreFilteringContext = new SortingOnCoreFilteringContext(_driver);
            var sortingResultContext          = new SortingResultContext(_driver);

            //act
            sortingOnCoreFilteringContext.SelectSortingByIncreasedPrice();
            var actualResult = sortingResultContext.GetSortingResultByPrice();
            var actualPrices = actualResult.Select(s => double.Parse(s.Replace("грн", string.Empty)
                                                                     .Replace(" ", string.Empty)
                                                                     .Replace(",", ".")));

            //assert
            CollectionAssert.IsOrdered(actualPrices, "The sorted prices should be increased.");
        }