Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
1 answer
2k views

Transliterate between Cyrillic and Latin scripts

I want to get a code review on the following transliteration code. I wrote it because there were some libraries that I have tried and they were specifically failing with the name "Yuliya" ...
nop's user avatar
  • 809
4 votes
3 answers
196 views

DistinctCount extension method

Here I go again. I have been finding a fairly common pattern in business logic code. And that pattern looks like this: ...
Jesse C. Slicer's user avatar
17 votes
3 answers
2k views

ExactlyOne extension method

I often find in codebases something on the order of if (sprockets.Count() > 0) which is easily replaced with LINQ's ...
Jesse C. Slicer's user avatar
0 votes
1 answer
361 views

Test helper method to assert if text could be found

Lately I've been getting a lot of critique in my code reviews at work, where typical comments have been that my variable names are unclear/confusing, flow in method could be simplified, unnecessary ...
Force444's user avatar
  • 253
4 votes
1 answer
465 views

Is a unit test which uses LINQ to check multiple values acceptable?

I'm writing unit tests for a library which parses colors from user input (example: the user input “#f00” gives a red color; the user input “60,100%,100%” gives a yellow color, etc.) One of the ...
Arseni Mourzenko's user avatar
4 votes
3 answers
6k views

VersionString (eg "1.0.2") IComparer algorithm

For a project I'm working on, I need to compare version strings where: version strings are composed only of numbers and periods version strings are made up of an arbitrary number of segments (major....
Jason Suárez's user avatar
3 votes
1 answer
1k views

How would I unit test a method that gets data from an RSS feed?

I have a method that gets an RSS feed using LINQ to XML and returns a collection of an object that grabs only the data I need. There's really only one other method in the class I'm concerned about ...
Mattio's user avatar
  • 133