Fix Naming

Change userService name to templateUserProfileService for templating.
Remove test subclass from MockScreenTest
This commit is contained in:
David Langley
2021-09-11 14:13:43 +01:00
parent 9e8a90ec2a
commit a73d8a4122
9 changed files with 41 additions and 31 deletions
@@ -21,7 +21,7 @@ import SwiftUI
/// Using an enum for the screen allows you define the different state cases with
/// the relevant associated data for each case.
@available(iOS 14.0, *)
enum MockTemplateProfileUserScreenState: MockScreenState, CaseIterable {
enum MockTemplateUserProfileScreenState: MockScreenState, CaseIterable {
// A case for each state you want to represent
// with specific, minimal associated data that will allow you
// mock that screen.
@@ -34,9 +34,9 @@ enum MockTemplateProfileUserScreenState: MockScreenState, CaseIterable {
}
/// A list of screen state definitions
static var allCases: [MockTemplateProfileUserScreenState] {
static var allCases: [MockTemplateUserProfileScreenState] {
// Each of the presence statuses
TemplateUserProfilePresence.allCases.map(MockTemplateProfileUserScreenState.presence)
TemplateUserProfilePresence.allCases.map(MockTemplateUserProfileScreenState.presence)
// A long display name
+ [.longDisplayName("Somebody with a super long name we would like to test")]
}
@@ -50,7 +50,7 @@ enum MockTemplateProfileUserScreenState: MockScreenState, CaseIterable {
case .longDisplayName(let displayName):
service = MockTemplateUserProfileService(displayName: displayName)
}
let viewModel = TemplateUserProfileViewModel(userService: service)
let viewModel = TemplateUserProfileViewModel(templateUserProfileService: service)
// can simulate service and viewModel actions here if needs be.