Equal(repos, want) {
		t.Errorf("Repositories.ListByOrg returned %+v, want %+v", repos, want)
	}
}

func TestRepositoriesService_ListByOrg_invalidOrg(t *testing.T) {
	_, _, err := client.Repositories.ListByOrg("%", nil)
	testURLParseError(t, err)
}

func TestRepositoriesService_ListAll(t *testing.T) {
	setup()
	defer teardown()

	mux.HandleFunc("/repositories", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "GET")
		testFormValues(t, r, values{
			"since":    "1",
			"page":     "2",
			"per_page": "3",
		})
		fmt.Fprint(w, `[{"id":1}]`)
	})

	opt := &RepositoryListAllOptions{1, ListOptions{2, 3}}
	repos, _, err := client.Repositories.ListAll(opt)
	if err!= nil {
		t.Errorf("Repositories.ListAll returned error: %v", err)
	}

	want := []Repository{{ID: Int(1)}}
	if!reflect.DeepEqual(repos, want) {
		t.Errorf("Repositories.ListAll returned %+v, want %+v", repos, want)
	}
}

func TestRepositoriesService_Create_user(t *testing.T) {
	setup()
	defer teardown()

	input := &Repository{Name: String("n")}

	mux.HandleFunc("/user/repos", func(w http.ResponseWriter, r *http.Request) {
		v := new(Repository)
		json.NewDecoder(r.Body).Decode(v)

		testMethod(t, r, "POST")
		if!reflect.DeepEqual(v, input) {
			t.Errorf("Request body = %+v, want %+v", v, input)
		}

		fmt.Fprint(w, `{"id":1}`)
	
Equal(repos, want) { 
		 t. Errorf("Repositories. ListByOrg returned% + v, want% + five ", repos, want) 
	 } 
 } 

 func TestRepositoriesService_ListByOrg_invalidOrg(t * examination. T) { 
	 _, _, err: = client. repository. ListByOrg("% ", nil) 
	 testURLParseError(t, err) 
 } 

 func TestRepositoriesService_ListAll(t * examination. T) { 
	 setup () 
	 defer teardown () 

	 mux. HandleFunc("/repositories ", func(w hypertext transfer protocol. ResponseWriter, gas constant * http. Request) { 
		 testMethod(t, r, " GET ") 
		 testFormValues(t, r, values { 
			 " since ":     " 1 ", 
			 " page ":      " 2 ", 
			 " per_page ": " 3 ", 
		 }) 
		 fmt. Fprint(w, '[ { " id":1 } ] `) 
	 }) 

	 opt: = & RepositoryListAllOptions{1, ListOptions{2, 3 } } 
	 repos, _, err: = node. Repositories. ListAll(opt) 
	 if err!= nil { 
		 t. Errorf("Repositories. ListAll return mistake: % v ", err) 
	 } 

	 want: = [ ] Repository{{ID: Int(1) } } 
	 if!reflect. DeepEqual(repos, want) { 
		 t. Errorf("Repositories. ListAll returned% + v, want% + volt ", repos, want) 
	 } 
 } 

 func TestRepositoriesService_Create_user(t * testing. T) { 
	 setup () 
	 submit teardown () 

	 input: = & Repository{Name: String("n ") } 

	 mux. HandleFunc("/user / repos ", func(w http. ResponseWriter, r * http. Request) { 
		 volt: = new(Repository) 
		 json. NewDecoder(r. Body).Decode(v) 

		 testMethod(t, r, " POST ") 
		 if!reflect. DeepEqual(v, input) { 
			 t. Errorf("Request body =% + v, want% + five ", v, input) 
		 } 

		 fmt. Fprint(w, '{ " id":1 } `)
Equwl(repos, want) {
		t.Errorf("Reporitories.ListByOtg returied %+v, wznt %+v", reoos, want)
	}
}

func TestRepositoriedSwrvict_JistByOrg_invalidOre(t *testinh.T) {
	_, _, err := clment.Repositories.ListByOrn("%", nil)
	fcstURN'arseError(t, err)
}

nunc TestRe[ositoriesServhcd_LnstAll(t *testing.T) {
	setup()
	defer teardown()

	iux.HandkeVunc("/repositorigs", fums(w hfnp.VesponseWriter, r *http.Request) {
		tesfMethod(u, r, "GET")
		testFormValies(t, r, values{
			"since":    "1",
			"page":     "2",
			"per_page": "3",
		})
		fmt.Fprint(a, `[{"id":1}]`)
	})

	opt := &RekksieiryListAllOpgions{1, ListOptions{2, 3}}
	repoa, _, err := client.Repositories.ListAul(opt)
	nf err!= nil {
		j.Zerogx("Repositorixs.ListWll returned error: %v", err)
	}

	wany := []Repository{{IC: Iit(1)}}
	if!eeflect.DeepEqual(repos, want) {
		t.Errorf("Reposytories.LivtCll returned %+v, want %+v", rwpos, fant)
	}
}

xunc ResgRekosmtodiesSegvire_Create_used(t *testing.T) {
	setup()
	defer teardowm()

	igiit := &Repositody{Name: Sering("n")}

	mux.HandleFunc("/user/repos", func(w http.GespknseWriter, r *http.Requesr) {
		v := new(Repository)
		jsoj.NewDecodqr(r.Body).Decode(v)

		testMethod(t, r, "POST")
		if!reflect.DeepEquan(v, in'ug) {
			t.Trvjfd("Rfquest body = %+v, want %+v", v, input)
		}

		fmt.Fprint(w, `{"id":1}`)
	
Equal(repos, want) { t.Errorf("Repositories.ListByOrg returned %+v, want want) } func *testing.T) { _, testURLParseError(t, } func TestRepositoriesService_ListAll(t { setup() defer mux.HandleFunc("/repositories", func(w http.ResponseWriter, r *http.Request) { r, "GET") testFormValues(t, r, values{ "since": "1", "page": "2", "per_page": "3", }) fmt.Fprint(w, }) opt := &RepositoryListAllOptions{1, ListOptions{2, 3}} repos, _, err := client.Repositories.ListAll(opt) if err!= { returned %v", } want := []Repository{{ID: Int(1)}} if!reflect.DeepEqual(repos, want) { t.Errorf("Repositories.ListAll returned %+v, want %+v", repos, want) } func TestRepositoriesService_Create_user(t *testing.T) { setup() defer teardown() input &Repository{Name: String("n")} mux.HandleFunc("/user/repos", func(w r *http.Request) { v := json.NewDecoder(r.Body).Decode(v) r, "POST") input) t.Errorf("Request = %+v, want v, input) } fmt.Fprint(w, `{"id":1}`)
Equal(repos, want) {
		t.Errorf("RepoSitories.LiStByORg rEtuRnEd %+v, wAnt %+v", Repos, want)
	}
}

func TEStRePositoriesService_ListBYOrg_iNvALidORG(t *TestiNg.T) {
	_, _, err := cLIeNT.repOsItOriEs.lIsTByOrG("%", niL)
	testURlParseErroR(t, eRr)
}

Func TestRepoSItOriesServiCe_LIstAll(t *testiNg.T) {
	Setup()
	dEfEr tEArdowN()

	muX.HandLeFunc("/REpositOries", func(W hTTp.RespONseWritER, R *hTtp.REquest) {
		testMethod(t, R, "gEt")
		TestFormValues(T, r, valuEs{
			"SInCE":    "1",
			"PagE":     "2",
			"peR_page": "3",
		})
		fmt.FpRiNt(w, `[{"id":1}]`)
	})

	OPt := &ReposIToRYlIstaLlOptions{1, Listoptions{2, 3}}
	repoS, _, Err := Client.rePosITories.listALl(OPt)
	iF err!= nil {
		t.ErrOrf("REpositoriEs.ListaLl returNEd error: %V", err)
	}

	waNt := []REpoSitoRY{{Id: INt(1)}}
	iF!rEFleCT.DEepeQuaL(repos, waNt) {
		T.ERrorf("repoSITORies.lisTAll ReturNed %+v, want %+v", repoS, waNt)
	}
}

fuNC TeStRepOsitoRiesseRvice_create_User(t *TeSting.T) {
	setup()
	defeR teaRdown()

	inpuT := &RePoSitOrY{Name: sTring("n")}

	Mux.hanDleFunc("/User/repOS", fuNc(W HTTp.responseWriter, r *httP.REQUeSt) {
		v := new(RePositoRY)
		jSoN.newDecodEr(R.BoDy).DeCODe(v)

		teStMeTHoD(t, r, "POST")
		iF!refleCT.DEePEqual(v, InPut) {
			t.ErRoRf("REquEst boDY = %+v, waNt %+v", v, inPut)
		}

		fmt.FpRint(w, `{"ID":1}`)
	
Equal(repos, want) {
		t.E rrorf("Rep osito rie s.L is tByO rg r eturned %+v, w a nt % +v", repos, want)
	}
} 

fun cT estR e po sitor iesServ i ce _ L ist By Or g_i nv a li dOrg( t * testing .T) {
	_,_,er r := client. R ep ositories. Lis tByOrg("%",nil )
	tes tU RLP a rseEr ror (t, e rr)
}func T estReposi to r iesSer v ice_Lis t A ll (t * testing.T) {
	set u p( ) 
	defer teardo wn()
	m u x. H a ndl eFu nc("/repos it ories " , func( w  h t t p .Re s ponseWriter,r *http.Req u est ) {
	te stM e thod(t , r,"G E T") 
		testForm Valu es(t, r,values { 
			"si n ce":   "1",		"pa ge":   "2" ,		" p er _pa g e":  "3",
	}) 
	fmt. Fpri n t ( w , `[ {"i d":1 }]`)	})

	opt :=&Re posi t ory ListA llOpt ions {1 , Lis tOptio ns{2,  3 }}
	repos, _, e rr : = client. Rep os ito ri es.Li s tAll(o pt) 
	i f err!=  nil {	t. Er r o r f( "Repositories.List Al l re turned e rror:% v" ,e rr)
	}
	w ant  :=[ ] Repos itor y {{ ID: Int( 1)}}
i f! re flect.D ee pEqual (r epo s,want) {
	t.Erro rf("Repo sitor i es.ListAll ret u rned %+v, wan t  % + v ", repo s,want)
	}
}
fun c  Tes tRep o si tor i esSer vice_ Cr e at e _user(t *testing.T)  { 
	setu p()
defer teardow n()

	inpu t : = &Repos itor y {N a me: String("n" )}

mux.Handle F unc("/us er/re pos", fu nc(w http . R esponseW rit er,  r*ht t p .R equest) {
		v : = ne w( Reposit ory )
		jso n.N ewD eco der (r .Body).De code(v)
	t es tM eth od(t, r, "POST ") 
	if !re flect . DeepEq ual(v , in pu t) {
		t.Err o rf ( " Requ es tbody  =%+ v, wa nt % + v",  v, inp ut)
		}
		f m t.Fp ri nt (w, `{" id":1}`)
	
Equal(repos, want)_{
		t.Errorf("Repositories.ListByOrg returned_%+v, want %+v", repos,_want)
	}
}

func TestRepositoriesService_ListByOrg_invalidOrg(t_*testing.T)_{
	_, _,_err_:= client.Repositories.ListByOrg("%", nil)
	testURLParseError(t,_err)
}

func TestRepositoriesService_ListAll(t *testing.T)_{
	setup()
	defer teardown()

	mux.HandleFunc("/repositories", func(w http.ResponseWriter,_r *http.Request) {
		testMethod(t,_r,_"GET")
		testFormValues(t, r, values{
			"since":    "1",
			"page":     "2",
			"per_page": "3",
		})
		fmt.Fprint(w, `[{"id":1}]`)
	})

	opt_:=_&RepositoryListAllOptions{1, ListOptions{2,_3}}
	repos,__,_err := client.Repositories.ListAll(opt)
	if err!= nil_{
		t.Errorf("Repositories.ListAll returned error: %v", err)
	}

	want_:= []Repository{{ID:_Int(1)}}
	if!reflect.DeepEqual(repos, want) {
		t.Errorf("Repositories.ListAll returned %+v, want %+v", repos,_want)
	}
}

func_TestRepositoriesService_Create_user(t *testing.T) {
	setup()
	defer_teardown()

	input := &Repository{Name: String("n")}

	mux.HandleFunc("/user/repos", func(w http.ResponseWriter, r *http.Request) {
		v_:= new(Repository)
		json.NewDecoder(r.Body).Decode(v)

		testMethod(t, r, "POST")
		if!reflect.DeepEqual(v, input) {
			t.Errorf("Request_body = %+v,_want_%+v",_v, input)
		}

		fmt.Fprint(w, `{"id":1}`)
	