         ]
 
         for expectedPassword: String in expectedValues {
+            XCTAssertEqualObjects(token.password(), expectedPassword, "The generator did not produce the expected OTP.")
             token = token.updatedToken()
-            XCTAssertEqualObjects(token.password(), expectedPassword, "The generator did not produce the expected OTP.")
         }
     }
 

    // https://code.google.com/p/google-authenticator/source/browse/mobile/ios/Classes/TOTPGeneratorTest.m
    func testTOTPGoogleValues() {
        let secret = "12345678901234567890".dataUsingEncoding(NSASCIIStringEncoding)
        let intervals: Array<NSTimeInterval> = [1111111111, 1234567890, 2000000000]
        let algorithms = [OTPAlgorithm.SHA1, OTPAlgorithm.SHA256, OTPAlgorithm.SHA512]

        let results = [
            // SHA1    SHA256    SHA512
            "050471", "584430", "380122", // date1
            "005924", "829826", "671578", // date2
            "279037", "428693", "464532", // date3
        ]

        for (var i = 0, j = 0; i < intervals.count; i++) {
            for algorithm in algorithms {
                let token = Token(type: .Timer, secret: secret, algorithm: algorithm, digits: 6, period: 30)
                let counter = UInt64(intervals[i] / token.period)
                
                XCTAssertEqualObjects(results[j],
                                      token.passwordForCounter(counter),
                                      "Invalid result \(i), \(algorithm), \(intervals[i])")
                j++
            }
        }
    }

        ]

        let expectedValues = [
            Token.Algorithm.SHA1:   ["94287082", "07081804", "14050471", "89005924", "69279037", "65353130"],
            Token.Algorithm.SHA256: ["46119246", "68084774", "67062674", "91819424", "90698825", "77737706"],
            Token.Algorithm.SHA512: ["90693936", "25091201", "99943326", "93441116", "38618901", "47863826"],
        ]

        for (algorithm, secretKey) in secretKeys {
