Introduction to Unit & API Testing - Workshop


UnitAPItestWS - Version:1
Description
Modern development, including micro-service architecture, is based on APIs. APIs open the doors for better flexibility, improved functionality, and incremental development. But the APIs we develop need to work. To support quality API development, we need to integrate API testing in different situations. Some of the code can be tested as a unit, and some of it can be tested through the APIs themselves. This workshop introduces the automation tooling and methodology for both. The workshop is intended for .net developers, with no prior experience in testing.
Intended audience
.net developers
Expand All
  • Testing theory
    • What are unit tests, API tests vs other types
    • How to choose the right test type
    • Running tests as part of continuous integration
  • Test planning & design
    • Methods of coming up with cases
    • Design techniques for API tests
  • Writing tests with NUnit (inc. exercise)
    • Test frameworks
    • Asserts as acceptance criteria.
    • Fixtures and suites
  • Test organization
    • Test separation considerations.
    • Methods as: features, functionality, speed, stability
  • Design for Testability
    • Testable architecture
    • Ports and adapters
  • Testing in legacy code (inc. exercise)
    • Isolation and mocking
    • Changing behavior and checking interaction
    • Types of mocks (manual, framework, simulators)
    • The Moq library
  • Refactoring code for testability (inc. exercise)
    • Refactoring without tests
    • Template-based tests for refactoring
  • API Tests (inc. exercise)
    • The RestSharp library
    • Writing tests for REST APIs
    • Mocking API calls with MockHttp
  • Attendees need a laptop with an IDE with pre-downloaded exercises
  • No testing experience is required.
  • Following the workshop, attendees will be able to:
  • ? Describe how automated testing (different types of tests) fit into iterative project development
  • ? Use unit testing tools (test framework, mocking framework, refactoring)
  • ? Refactor code to make it more testable
  • ? Mock different kinds of dependencies (including other API calls)
  • ? Write API tests