11
22import  org .scalatest .FunSpec 
3+ import  org .scalatest .BeforeAndAfter 
34import  scala .concurrent .Await 
45import  org .joda .time .DateTime 
56import  org .joda .time .DateTimeZone 
@@ -12,6 +13,8 @@ import codecheck.github.models.Issue
1213import  codecheck .github .models .IssueInput 
1314import  codecheck .github .models .MilestoneSearchOption 
1415
16+ import  codecheck .github .models .MilestoneInput 
17+ 
1518class  IssueOpSpec  extends  FunSpec  with  Constants  {
1619
1720  val  number  =  1 
@@ -108,6 +111,7 @@ class IssueOpSpec extends FunSpec with Constants {
108111    it(" shold return at least one issue." 
109112      val  result  =  Await .result(api.listAllIssues(), TIMEOUT )
110113      assert(result.length >  0 )
114+       assert(result.head.repository.name ==  " test-repo" 
111115    }
112116
113117    it(" shold return only two issues when using options." 
@@ -122,6 +126,7 @@ class IssueOpSpec extends FunSpec with Constants {
122126    it(" shold return at least one issue." 
123127      val  result  =  Await .result(api.listUserIssues(), TIMEOUT )
124128      assert(result.length >  0 )
129+       assert(result.head.repository.name ==  " test-repo" 
125130    }
126131
127132    it(" shold return only one issues when using options." 
@@ -148,7 +153,7 @@ class IssueOpSpec extends FunSpec with Constants {
148153
149154  describe(" listRepositoryIssues(owner, repo, option)" 
150155    it(" should return at least one issue from user's own repo." 
151-       val  result  =  Await .result(api.listRepositoryIssues(organization, repo ), TIMEOUT )
156+       val  result  =  Await .result(api.listRepositoryIssues(user, userRepo ), TIMEOUT )
152157      assert(result.length >  0 )
153158    }
154159
@@ -159,17 +164,17 @@ class IssueOpSpec extends FunSpec with Constants {
159164
160165    it(" should return only one issue from user's own repo when using options." 
161166      val  option  =  new  IssueListOption4Repository (Some (MilestoneSearchOption (1 )), IssueState .open, Some (user), Some (user), labels= Seq (" question" = Some (nTime))
162-       val  result  =  Await .result(api.listRepositoryIssues(user, userRepo), TIMEOUT )
163-       // showResponse(result )
167+       val  result  =  Await .result(api.listRepositoryIssues(user, userRepo, option ), TIMEOUT )
168+       showResponse(option.q )
164169      assert(result.length ==  1 )
170+       assert(result.head.title ==  " test issue" 
165171    }
166172
167173    it(" should return only one issue from organization's repo when using options." 
168-       val  option  =  IssueListOption4Repository (Some (MilestoneSearchOption .all ), IssueState .open, Some (user), Some (user), labels= Seq (" question" = Some (nTime))
174+       val  option  =  new   IssueListOption4Repository (Some (MilestoneSearchOption ( 1 ) ), IssueState .open, Some (user), Some (user), labels= Seq (" question" = Some (nTime))
169175      val  result  =  Await .result(api.listRepositoryIssues(organization, repo, option), TIMEOUT )
170-       showResponse(option.q)
171-       showResponse(result)
172-       // assert(result.length == 1)
176+       assert(result.length ==  1 )
177+       assert(result.head.title ==  " test issue" 
173178    }
174179  }
175180
0 commit comments