コード例 #1
0
        public void TestContains()
        {
            // Arrange
            List <RestaurantInfo> expectedList = new List <RestaurantInfo> {
                dummy1, dummy3
            };

            // Act
            SortRestaurants.Contains(ref actualList3, "Do");

            // Assert
            CollectionAssert.AreEqual(expectedList, actualList3);
        }
コード例 #2
0
        public void TestSortBy()
        {
            // Arrange
            List <RestaurantInfo> expectedList = new List <RestaurantInfo> {
                dummy1, dummy3, dummy2, dummy4, dummy5
            };

            // Act
            SortRestaurants.SortBy(ref actualList1, "rating", "asc");

            // Assert
            CollectionAssert.AreEqual(expectedList, actualList1);
        }
コード例 #3
0
        public void TestTop()
        {
            // Arrange
            List <RestaurantInfo> expectedList = new List <RestaurantInfo> {
                dummy5, dummy4, dummy2
            };

            // Act
            SortRestaurants.Top(ref actualList2, 3);


            // Assert
            CollectionAssert.AreEqual(expectedList, actualList2);
        }