Skip to content

Commit

Permalink
test it
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokisan committed Mar 9, 2023
1 parent 44348bb commit 1c8fe39
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions run_report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,31 @@ func TestRunReport(t *testing.T) {
assert.Equal(t, propertyQuota.TokensPerProjectPerHour.Consumed*int64(wantRequestedCount), resp.PropertyQuota.TokensPerProjectPerHour.Consumed)
})
}

func TestDimensionIndex(t *testing.T) {
targetColumn := DimensionDate
res := RunReportResponse{
RunReportResponse: &analyticsdata.RunReportResponse{
DimensionHeaders: []*analyticsdata.DimensionHeader{
{
Name: targetColumn,
},
},
},
}
assert.Equal(t, 0, res.DimensionIndex(targetColumn))
}

func TestMetricIndex(t *testing.T) {
targetColumn := MetricSessions
res := RunReportResponse{
RunReportResponse: &analyticsdata.RunReportResponse{
MetricHeaders: []*analyticsdata.MetricHeader{
{
Name: targetColumn,
},
},
},
}
assert.Equal(t, 0, res.MetricIndex(targetColumn))
}

0 comments on commit 1c8fe39

Please sign in to comment.