score:2
Accepted answer
you need to unit-test the second method just to make sure it works. if you refactor something that changes how it works and fix the first one, how will you know if you forgot to fix the second one? if you refactor withordering
, how will you know that things still work? i would have a unit test to test ascending and one to test descending.
Source: stackoverflow.com
Related Query
- How to reuse a linq expression for 'Where' when using multiple source tables
- How to write LINQ Queries for CRUD using Entity Framework?
- If using LINQ For Queries, Do We Need to Unit-Test Sorting?
- Impose a sorting rule for Nullable values using LINQ
- Stubbing Code for Test With Linq Expressions and Lambdas
- Using LINQ query result for data source for GridControl c#
- Write Dynamic LINQ queries for sorting and projecting with EF Core
- Code Rewite for tuple and if else statements by using LINQ
- Cannot build the Test project for LINQ IQueryable Toolkit (IQToolkit) - Code 9009
- Nested sorting for predefined filters using LINQ and RavenDB
- How to write unit test for methods using nHibernate
- Compiling Error with LINQ Sorting Code Using List<T>
- How to write Linq Queries for CRUD operations using Entity Framework with Asp.Net?
- source code for LINQ 101 samples
- I need to save the XML file using linq with xml code in C#
- Problem using LINQ queries with GetItemLinqQueryable for CosmosDB
- Need to insert a string if array returns empty using linq queries
- Simplify the following code to a one-liner using Linq queries
- LINQ Intersect Query for Many to Many relationship using .NET4 MVC4 Code First
- how to fetch data from database using linq query for relationship 1:N and N:N (between 3 entity) in asp.net mvc EF code first?
- Getting InvalidCastException when trying to implement sorting in Entity Framework Code First using Linq
- What would be the Linq code for this grouping using VB.NET 2008?
- Convert string[] to int[] in one line of code using LINQ
- How are people unit testing code that uses Linq to SQL
- Alphanumeric sorting using LINQ
- Using LINQ for an object that only has GetEnumerator()
- Extension method for IQueryable left outer join using LINQ
- Unit test error : This function can only be invoked from LINQ to Entities
- Performance for using 2 where clauses in LINQ
- Topological Sorting using LINQ
More Query from same tag
- How to add another top level node
- LINQ multiple joins with a Group By not Working
- Using LINQ to return just two specific DataTables in a DataSet with several DataTables
- How to resolve variable in Linq Query c#?
- Using LINQ to SQL to get distinct value of an IQueryable resultset
- ? Operator used in LINQ
- Add attributes to XML element based on the input
- Linq-to-SQL - how to concatenate two fields in a sub select
- How to display IEnumerable item in asp.net mvc 3
- Correct implementation of IGrouping to be used inside longlistselector groupheader
- Return type of Linq on Datatable
- Search - IQueryable Linq
- Linq Search Between Two List
- Dynamic query building with entity framework core - Build a query "by steps"
- Grouping by range of values with linq and entity framework
- C# order a list of alphanumeric numbers
- convert SQL query with multiple join on multiple tables using group by on multiple columns and with aggregate function into LINQ
- How to use a simple select in entity framework 6
- LINQ - Different results with LINQ to SQL vs LINQPad
- Get only four objects by type and date LINQ
- Entity Framework with LINQ aggregate to concatenate string?
- Using LINQ Contains versus SqlMethods.Like
- Create a reusable "meta-predicate" function accepting lambda operand parameters
- How to get total results count before .Take() - but when using .Take()
- Do List.Exist using Linq
- Modifying properties in object with LINQ and functions Lamba
- GroupBy on strings (hashcode collision)
- Creating ILookups
- Entity Framework dbset most efficient way of deleting
- IDbSet with IEnumerable Linq where casting required?