how to write a rule to check hard code strings in my code.

Dec 13, 2011 at 10:47 PM

 public void method()

            {

                  string Y = "bbbbb";

                  if (Y.Equals("TEST"))

                  {

                        Y = "ERROR";

                  }

            }

whenever i get this statment it should violate the rule.