How azamsharp/unittestingworkshop works
Project Type Analysis
This is an educational iOS project demonstrating various testing methodologies through two main applications:
• BudgetApp (focusing on Unit Testing)
• LoanApp (demonstrating Integration Testing, Mocking, and End-to-End Testing)
Main Components
A. Testing Layers (Hierarchical Structure)
┌─────────────────────────┐
• End-to-End Tests │
• ┤
• Integration Tests │
• ┤
• Unit Tests │
• ┤
• Application Code │
• ┘
B. Application Architecture (For each app):
┌─────────────────┐
• UI Layer │
• (SwiftUI) │
• ┤
• Business Logic │
• (Services) │
• ┤
• Models │
• ┘
Specific Components
For LoanApp:
┌─────────────────────────────────────────┐
• UI Components │
• RegistrationScreen │
• CustomerListScreen │
• ┤
• Services │
• APRService │
• CreditScoreService (Real & Mocked) │
• ┤
• Models │
• CreditScoreResponse │
• ┘
Testing Components
┌─────────────────────────────────────────┐
• End-to-End Tests │
• LoanAppUITests │
• ┤
• Integration Tests │
• CustomerListScreenTests │
• RegistrationScreenTests │
• ┤
• Unit Tests │
• BudgetAppTests │
• MockedCreditScoreService │
• ┘
Important Elements to Highlight
• Mock Service implementations
• Different testing environments (configured through Xcode settings)
• Relationship between real and mocked services
• Test data files (e.g., credit-score-response.json)