     func testGetIOSVersion() {
         XCTAssertEqual(NSProcessInfo().operatingSystemVersionString, context.getIOSVersion())
     }
-    
+
     func testMultiConnectErrors() {
         var error: AppContextError?
         do {

//

import XCTest

class AppContextTests: XCTestCase {
    var context: AppContext! = nil

    }

    func testUpdateNetworkStatus() {
        let delegateMock = AppContextDelegateMock()
        context.delegate = delegateMock
        let _ = try? context.didRegisterToNative([AppContextJSEvent.networkChanged, NSNull()])
        XCTAssertTrue(delegateMock.networkStatusUpdated, "network status is not updated")
    }

    func testWillEnterBackground() {
        let delegateMock = AppContextDelegateMock()
        context.delegate = delegateMock
        NSNotificationCenter.defaultCenter().postNotificationName(UIApplicationWillResignActiveNotification, object: nil)
        XCTAssertTrue(delegateMock.willEnterBackground)
    }

    func testDidEnterForeground() {
        let delegateMock = AppContextDelegateMock()
        context.delegate = delegateMock
        NSNotificationCenter.defaultCenter().postNotificationName(UIApplicationDidBecomeActiveNotification, object: nil)
        XCTAssertTrue(delegateMock.didEnterForeground)
    }

    func testDidRegisterToNative() {
