Skip to content

Commit 1c8fe39

Browse files
committed
test it
1 parent 44348bb commit 1c8fe39

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

run_report_test.go

+28
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,31 @@ func TestRunReport(t *testing.T) {
108108
assert.Equal(t, propertyQuota.TokensPerProjectPerHour.Consumed*int64(wantRequestedCount), resp.PropertyQuota.TokensPerProjectPerHour.Consumed)
109109
})
110110
}
111+
112+
func TestDimensionIndex(t *testing.T) {
113+
targetColumn := DimensionDate
114+
res := RunReportResponse{
115+
RunReportResponse: &analyticsdata.RunReportResponse{
116+
DimensionHeaders: []*analyticsdata.DimensionHeader{
117+
{
118+
Name: targetColumn,
119+
},
120+
},
121+
},
122+
}
123+
assert.Equal(t, 0, res.DimensionIndex(targetColumn))
124+
}
125+
126+
func TestMetricIndex(t *testing.T) {
127+
targetColumn := MetricSessions
128+
res := RunReportResponse{
129+
RunReportResponse: &analyticsdata.RunReportResponse{
130+
MetricHeaders: []*analyticsdata.MetricHeader{
131+
{
132+
Name: targetColumn,
133+
},
134+
},
135+
},
136+
}
137+
assert.Equal(t, 0, res.MetricIndex(targetColumn))
138+
}

0 commit comments

Comments
 (0)