LaunchCode logo
  1. Contents
  2. 20. Unit Testing

20. Unit TestingΒΆ

  • 20.1. Why Test Your Code?
    • 20.1.1. Know Your Code Really Works
    • 20.1.2. Find Regressions
    • 20.1.3. Tests as Documentation
  • 20.2. Testing in C#
    • 20.2.1. Why We Test
      • 20.2.1.1. Refactoring
      • 20.2.1.2. Documentation
    • 20.2.2. Testing Best Practices
    • 20.2.3. Check Your Understanding
  • 20.3. Unit Testing In Action With MSTest
    • 20.3.1. What To Test
    • 20.3.2. C# Attributes
    • 20.3.3. Testing Setup
      • 20.3.3.1. Car and CarTests
    • 20.3.4. [TestClass] and [TestMethod]
    • 20.3.5. Check Your Understanding
  • 20.4. Running Tests in Visual Studio
    • 20.4.1. Mac Users: Running Tests
    • 20.4.2. Windows Users: Running Tests
    • 20.4.3. All Users: Output
    • 20.4.4. Creating Tests
  • 20.5. Running Tests Part 2:
    • 20.5.1. [TestInitialize]
    • 20.5.2. [TestCleanup]
    • 20.5.3. Common Assert Methods
    • 20.5.4. Check Your Understanding
  • 20.6. Test-Driven Development
    • 20.6.1. The Test/Code Cycle
  • 20.7. The Red, Green, Refactor Methodology
  • 20.8. Exercises: Unit Testing
    • 20.8.1. TestGasTankAfterDriving()
    • 20.8.2. TestGasTankAfterExceedingTankRange()
    • 20.8.3. TestGasOverfillException()
  • 20.9. Studio: Unit Testing
    • 20.9.1. Getting Started
    • 20.9.2. Uploading Your Work
  • ← 19.6. Studio: Restaurant Menu Continued
  • 20.1. Why Test Your Code? →

Back to top