I can't understand why I need to "force unwrap" variable type in it's declaration in my tests.
Let me give you an example to be more clear:
class testSomething: XCTestCase {
var mockService: MockService!
override func setUp() {
mockService = MockService()
}
...
So the goal obviously is to create a fresh instance of the mock service every time I run the test. I just don't understand why I need to declare this variable as MockService!
type. What does the exclamation point after type really mean in this context?
Just to be clear, when I declare mockService: MockService
Xcode complains that my test class does not have initializers