         let expectation1 = expectation(description: "Empty email and password")
         service.login(email: "", password: "") { result in
             switch result {
-            case .fail(let info):
-                switch info {
-                case .wrongPassword : break
-                default : XCTFail("Error 'info' is not of type '.wrongPassword'")
-                }
-                
-            default:
-                XCTFail("'result' is not of type '.fail'")
+            case .fail(let info) where info == .wrongPassword:
+                break
+                
+            default:
+                XCTFail()
             }
             expectation1.fulfill()
         }

        waitForExpectations(timeout: timeout)
    }
    
    func testLoginHasErrorResultWithEmailNotFound() {
        let access = RemoteDatabaseAccessMock()
        let database = RemoteDatabaseMock()
        let service = AuthRemoteService(access: access, database: database)!

        let expectation2 = expectation(description: "Existing email and empty password")
        service.login(email: "me@me.com", password: "") { result in
            switch result {
            case .fail(let info) where info == .wrongPassword:
                break
                
            default:
                XCTFail()
            }
            expectation2.fulfill()
        }
        
        let expectation3 = expectation(description: "Existing email and mismatched password")
        service.login(email: "me@me.com", password: "abcdef12345678") { result in
            switch result {
            case .fail(let info) where info == .wrongPassword:
                break
                
            default:
                XCTFail()
            }
            expectation3.fulfill()
        }
