                                 for period in periods {
                                     for counter in counters {
                                         // Create the token
-                                        let token = OTPToken(type: type, secret:secretString.dataUsingEncoding(NSASCIIStringEncoding), name:name, issuer:issuer, algorithm:algorithm, digits:digitNumber)
-                                        token.period = period;
-                                        token.counter = counter;
+                                        let token = Token(type: type, secret:secretString.dataUsingEncoding(NSASCIIStringEncoding), name:name, issuer:issuer, algorithm:algorithm, digits:digitNumber, period: period, counter: counter)
 
                                         // Serialize
-                                        let url = token.url;
+                                        let url = token.url();
 
                                         // Test scheme
                                         XCTAssertEqualObjects(url.scheme, kOTPScheme, "The url scheme should be \"\(kOTPScheme)\"");

import XCTest
import OneTimePassword

/*
let kOTPScheme = "otpauth";
let kOTPTokenTypeCounterHost = "hotp";
let kOTPTokenTypeTimerHost   = "totp";

let types: OTPToken.TokenType[] = [.Counter, .Timer];
let names = ["", "Login", "user_123@website.com", "Léon", ":/?#[]@!$&'()*+,;=%\""];
let issuers = ["", "Big Cörpøráçìôn", ":/?#[]@!$&'()*+,;=%\""];
let secretStrings = ["12345678901234567890", "12345678901234567890123456789012", "1234567890123456789012345678901234567890123456789012345678901234", ""];
let algorithms: OTPToken.Algorithm[] = [.SHA1, .SHA256, .SHA512];
let digits = [6, 7, 8];
let periods: NSTimeInterval[] = [0, 1, 30];
let counters: UInt64[] = [0, 1, 18_446_744_073_709_551_615];


                                        // Test period
                                        if type == .Timer {
                                            XCTAssertEqualObjects(queryArguments["period"], String(Int(period)), "The period value should be \"\(period)\"");
                                        } else {
                                            XCTAssertNil(queryArguments["period"], "The url query string should not contain the period");
                                        }
