...
|
...
|
@@ -35,10 +35,14 @@ func TestGetRootDepartment(t *testing.T) { |
|
|
func TestSortDepartmentStastics(t *testing.T) {
|
|
|
s := &protocol.DepartmentStatisticsResponse{
|
|
|
List: []*protocol.DepartmentStatistics{
|
|
|
{ChanceApprovedTotal: 8, AchievementTotal: 12, ACTotal: 20},
|
|
|
{ChanceApprovedTotal: 12, AchievementTotal: 8, ACTotal: 20},
|
|
|
{ChanceApprovedTotal: 8, AchievementTotal: 12, ACTotal: 20},
|
|
|
{ChanceApprovedTotal: 20, AchievementTotal: 20, ACTotal: 40},
|
|
|
{ChanceApprovedTotal: 5, AchievementTotal: 10, ACTotal: 15},
|
|
|
{Dep: protocol.Dep{Id: 3}, ChanceApprovedTotal: 6, AchievementTotal: 10, ACTotal: 16},
|
|
|
{Dep: protocol.Dep{Id: 2}, ChanceApprovedTotal: 6, AchievementTotal: 10, ACTotal: 16},
|
|
|
{Dep: protocol.Dep{Id: 1}, ChanceApprovedTotal: 6, AchievementTotal: 10, ACTotal: 16},
|
|
|
{ChanceApprovedTotal: 20, AchievementTotal: 30, ACTotal: 50},
|
|
|
},
|
|
|
//List: []*protocol.DepartmentStatistics{
|
|
|
// {ChanceApprovingTotal: 10},
|
...
|
...
|
@@ -49,6 +53,7 @@ func TestSortDepartmentStastics(t *testing.T) { |
|
|
// {ChanceApprovingTotal: 50},
|
|
|
//},
|
|
|
}
|
|
|
sort.Sort(s)
|
|
|
sort.Stable(s)
|
|
|
sort.Stable(sort.Reverse(s))
|
|
|
t.Log(common.AssertJson(s))
|
|
|
} |
...
|
...
|
|