You have a method that accepts more than 2 parameters - reidev275/SignsYouShouldProbablyRefactor GitHub Wiki

Example

void AddUser(string username, string password, int age)

Why is this bad?

  1. Logically we should be adding a user object
  2. If we add another parameter we break the interface and will be forced to change all of the calling code
  3. Required number of unit tests for argument exceptions is a multiple of the number of parameters

Resolved

void AddUser(IUser userToAdd)

interface IUser
{
  string Username { get; set; }
  string Password { get; set; }
  int Age { get; set; }
}