         delegate.expect([willAdd, didAdd])
         manager.addTab()
         delegate.verify("Not all delegate methods were called")
+        XCTAssertEqual(manager.normalTabs.count, 1, "There should be one normal tab")
+    }
+
+    func testAddTabShouldAddOnePrivateTab() {
+        let profile = TabManagerMockProfile()
+        let manager = TabManager(prefs: profile.prefs, imageStore: nil)
+        let delegate = MockTabManagerDelegate()
+        manager.addDelegate(delegate)
+
+        delegate.expect([willAdd, didAdd])
+        manager.addTab(isPrivate: true)
+        delegate.verify("Not all delegate methods were called")
+        XCTAssertEqual(manager.privateTabs.count, 1, "There should be one private tab")
+    }
+
+    func testAddTabAndSelect() {
+        let profile = TabManagerMockProfile()
+        let manager = TabManager(prefs: profile.prefs, imageStore: nil)
+
+        manager.addTabAndSelect()
+        XCTAssertEqual(manager.selectedIndex, 0, "There should be selected first tab")
+    }
+
+    func testMoveTabFromLastToFirstPosition() {
+        let profile = TabManagerMockProfile()
+        let manager = TabManager(prefs: profile.prefs, imageStore: nil)
+        // add two tabs, last one will be selected
+        manager.addTab()
+        manager.addTabAndSelect()
+        manager.moveTab(isPrivate: false, fromIndex: 1, toIndex: 0)
+        XCTAssertEqual(manager.selectedIndex, 0, "There should be selected second tab")
     }
 
     func testDidDeleteLastTab() {

        XCTAssertEqual(stateDelegate.numberOfTabsStored, 0, "Expected state delegate to have been called with 3 tabs, but called with \(stateDelegate.numberOfTabsStored)")
    }

    func testAddTab() {
        let profile = TabManagerMockProfile()
        let manager = TabManager(prefs: profile.prefs, imageStore: nil)
        let delegate = MockTabManagerDelegate()

        delegate.verify("Not all delegate methods were called")
    }

    func testRemoveTabSelectedTabShouldChangeIndex() {
        let profile = TabManagerMockProfile()
        let manager = TabManager(prefs: profile.prefs, imageStore: nil)

        let tab1 = manager.addTab()
        manager.addTab()
        let tab3 = manager.addTab()

        manager.selectTab(tab3)
        let beforeRemoveTabIndex = manager.selectedIndex
        manager.removeTab(tab1)
        XCTAssertNotEqual(manager.selectedIndex, beforeRemoveTabIndex)
        XCTAssertEqual(manager.selectedTab, tab3)
        XCTAssertEqual(manager.tabs[manager.selectedIndex], tab3)
    }

    func testRemoveTabRemovingLastNormalTabShouldNotSwitchToPrivateTab() {
        let profile = TabManagerMockProfile()
        let manager = TabManager(prefs: profile.prefs, imageStore: nil)

        let tab0 = manager.addTab()
        let tab1 = manager.addTab(isPrivate: true)

        manager.selectTab(tab0)
        // select private tab, so we are in privateMode
        manager.selectTab(tab1, previous: tab0)
        // if we are able to remove normal tab this means we are no longer in private mode
        manager.removeTab(tab0)
        // manager should creat new tab and select it
        XCTAssertNotEqual(manager.selectedTab, tab1)
        XCTAssertNotEqual(manager.selectedIndex, manager.tabs.index(of: tab1))
    }

    func testRemoveAllShouldRemoveAllTabs() {
        let profile = TabManagerMockProfile()
        let manager = TabManager(prefs: profile.prefs, imageStore: nil)

        let tab0 = manager.addTab()
        let tab1 = manager.addTab()

        manager.removeAll()
        XCTAssert(nil == manager.tabs.index(of: tab0))
        XCTAssert(nil == manager.tabs.index(of: tab1))
    }

    // Private tabs and regular tabs are in the same tabs array.
    // Make sure that when a private tab is added inbetween regular tabs it isnt accidently selected when removing a regular tab
    func testTabsIndex() {
