Posts

Showing posts from September, 2018

Do We Need Unit Test

Scenario 1(New Application/Module):- Lets us assume below two classes which are exposed by a windows application:-        public   class   Multiplication     {          public   int  Multiply( int  x,  int  y)         {              return  x * y;         }     }      public   class   CalculatePower     {          public   int  RaiseTo( int  number,  int  power)         {              if  (power < 0)             {  throw   new   ArgumentException ( "Power cannot be negative" ); }              int  result=1;              Multiplication  multiply= new   Multiplication ();              for  ( int  i = 1; i <= power; i++)             {                 result = multiply.Multiply(result, number);             }              return  result;         }     } Now developer will have to wait till UI is ready for him to test his code " Hence Unit Test Is Needed In This Scenario " which will test his code without any interfa