| Defensive Programming in C# | 
|---|
  
    | Course Outline | Outline | 
  
    | Reading Material |  | 
  
    | PowerPoint Slides | Intro.pptx | 
  | Day | Modules | Sharing | 
|---|
  
    | 1 | 
    
        What is Defensive Programming?Clean CodeTestable Code and Unit TestsPredictable Code |  | 
  
    | 
    
        Clean, Testable, and Predictable MethodsExample Clean, Testable, and Predictable MethodsDemo Creating a Class Library ComponentDemo Clean, Testable, and Predictable MethodsDemo Named Arguments |  | 
  
    | 
    
        Validating Method ParametersDemo Validating Method ParametersDemo Method Overloading |  | 
  
    | 2 | 
    
        Why automated testing?Code First vs. Test FirstDefining Unit Test CasesCreating Unit TestsUsing Test ExplorerGenerating Unit TestsUnit Tests and ExceptionsDependencies |  | 
  
    | 
    
        Method ResultsDemo Returning a ValueDemo Returning ExceptionsDemo Returning Multiple ValuesReturning Null |  | 
  
    | 
    
        Local Variable DeclarationsIf StatementsSwitch StatementsEnumsCasting |  | 
  
    | 3 | 
    
        Demo Preparing the Sample CodeAssertsAnticipated ErrorsUnexpected Exceptions and a Global Exception HandlerException Handling |  | 
  
    | 
    
        IntroductionTolerant Vs Demanding coding stylesPre-ConditionsPost-ConditionsClass InvariantLoop Invariant |  | 
  
    |  |  |