 
     it 'should be empty, when remove 1 project from 1 project', () ->
       expect(Project.get()).to.be.empty
-
-      # create test data
-      prj1 =
-        url: "https://github.com/ujiro99/RedmineTimeTracker"
-        urlIndex: 2
-        id: 0
-        text: "first"
-        show: SHOW.DEFAULT
-
-      # execute
-      Project.add(prj1)
-      Project.remove(prj1.url, prj1.id)
+      
+      # execute
+      Project.add(prj1[0])
+      Project.remove(prj1[0].url, prj1[0].id)
 
       # assert
       added = Project.get()

  Project = null
  Chrome = null


  beforeEach () ->
    angular.mock.module('timeTracker')


    it 'add 1 project', () ->
      expect(Project.get()).to.be.empty
      Project.add(prj1[0])
      added = Project.get()
      expect(added[prj1[0].url].index).to.be.equal(prj1[0].urlIndex)
      expect(added[prj1[0].url][prj1[0].id].text).to.be.equal(prj1[0].text)
      expect(added[prj1[0].url][prj1[0].id].show).to.be.equal(prj1[0].show)

    it 'update a project', () ->
      expect(Project.get()).to.be.empty

      # create test data
      updated =
        url: "http://redmine.com"
        urlIndex: 2   # same url and urlIndex
        id: 0         # same id
        text: "prj_updated"
        show: SHOW.SHOW

      # execute
      Project.add(prj1[0])
      Project.add(updated)

      # assert
      added = Project.get()
      expect(added[prj1[0].url].index).to.be.equal(prj1[0].urlIndex)
      expect(added[prj1[0].url][prj1[0].id].text).to.not.be.equal(prj1[0].text)
      expect(added[prj1[0].url][prj1[0].id].show).to.not.be.equal(prj1[0].show)
      expect(added[updated.url].index).to.be.equal(updated.urlIndex)
      expect(added[updated.url][updated.id].text).to.be.equal(updated.text)
      expect(added[updated.url][updated.id].show).to.be.equal(updated.show)

    it 'add 2 projects on same redmine server', () ->
      expect(Project.get()).to.be.empty

      # execute
      Project.add(prj1[0])
      Project.add(prj1[1])

      # assert
      added = Project.get()
      expect(added[prj1[0].url].index).to.be.equal(prj1[0].urlIndex)
      expect(added[prj1[0].url][prj1[0].id].text).to.be.equal(prj1[0].text)
      expect(added[prj1[0].url][prj1[0].id].show).to.be.equal(prj1[0].show)
      expect(added[prj1[1].url].index).to.be.equal(prj1[1].urlIndex)
      expect(added[prj1[1].url][prj1[1].id].text).to.be.equal(prj1[1].text)
      expect(added[prj1[1].url][prj1[1].id].show).to.be.equal(prj1[1].show)

    it 'add 2 projects on different redmine server', () ->
      expect(Project.get()).to.be.empty

      # execute
      Project.add(prj1[0])
      Project.add(prj2[0])

      # assert
      added = Project.get()
      expect(added[prj1[0].url].index).to.be.equal(prj1[0].urlIndex)
      expect(added[prj1[0].url][prj1[0].id].text).to.be.equal(prj1[0].text)
      expect(added[prj1[0].url][prj1[0].id].show).to.be.equal(prj1[0].show)
      expect(added[prj2[0].url].index).to.be.equal(prj2[0].urlIndex)
      expect(added[prj2[0].url][prj2[0].id].text).to.be.equal(prj2[0].text)
      expect(added[prj2[0].url][prj2[0].id].show).to.be.equal(prj2[0].show)

    it 'add 3 projects on same redmine server', () ->
      expect(Project.get()).to.be.empty

      # execute
      Project.add(prj1[0])
      Project.add(prj1[1])
      Project.add(prj1[2])

      # assert
      added = Project.get()
      expect(added[prj1[0].url].index).to.be.equal(prj1[0].urlIndex)
      expect(added[prj1[0].url][prj1[0].id].text).to.be.equal(prj1[0].text)
      expect(added[prj1[0].url][prj1[0].id].show).to.be.equal(prj1[0].show)
      expect(added[prj1[1].url].index).to.be.equal(prj1[1].urlIndex)
      expect(added[prj1[1].url][prj1[1].id].text).to.be.equal(prj1[1].text)
      expect(added[prj1[1].url][prj1[1].id].show).to.be.equal(prj1[1].show)
      expect(added[prj1[2].url].index).to.be.equal(prj1[2].urlIndex)
      expect(added[prj1[2].url][prj1[2].id].text).to.be.equal(prj1[2].text)
      expect(added[prj1[2].url][prj1[2].id].show).to.be.equal(prj1[2].show)

    it 'add 3 projects on same/different redmine server', () ->
      expect(Project.get()).to.be.empty

      # execute
      Project.add(prj1[0])
      Project.add(prj2[0])
      Project.add(prj1[1])

      # assert
      added = Project.get()
      expect(added[prj1[0].url].index).to.be.equal(prj1[0].urlIndex)
      expect(added[prj1[0].url][prj1[0].id].text).to.be.equal(prj1[0].text)
      expect(added[prj1[0].url][prj1[0].id].show).to.be.equal(prj1[0].show)
      expect(added[prj2[0].url].index).to.be.equal(prj2[0].urlIndex)
      expect(added[prj2[0].url][prj2[0].id].text).to.be.equal(prj2[0].text)
      expect(added[prj2[0].url][prj2[0].id].show).to.be.equal(prj2[0].show)
      expect(added[prj1[1].url].index).to.be.equal(prj1[1].urlIndex)
      expect(added[prj1[1].url][prj1[1].id].text).to.be.equal(prj1[1].text)
      expect(added[prj1[1].url][prj1[1].id].show).to.be.equal(prj1[1].show)

    it 'add 3 projects on different redmine server', () ->
      expect(Project.get()).to.be.empty

      # execute
      Project.add(prj1[0])
      Project.add(prj2[0])
      Project.add(prj3[0])

      # assert
      added = Project.get()
      expect(added[prj1[0].url].index).to.be.equal(prj1[0].urlIndex)
      expect(added[prj1[0].url][prj1[0].id].text).to.be.equal(prj1[0].text)
      expect(added[prj1[0].url][prj1[0].id].show).to.be.equal(prj1[0].show)
      expect(added[prj2[0].url].index).to.be.equal(prj2[0].urlIndex)
      expect(added[prj2[0].url][prj2[0].id].text).to.be.equal(prj2[0].text)
      expect(added[prj2[0].url][prj2[0].id].show).to.be.equal(prj2[0].show)
      expect(added[prj3[0].url].index).to.be.equal(prj3[0].urlIndex)
      expect(added[prj3[0].url][prj3[0].id].text).to.be.equal(prj3[0].text)
      expect(added[prj3[0].url][prj3[0].id].show).to.be.equal(prj3[0].show)


  ###
