...
1
16
17 package volume
18
19 import (
20 "testing"
21 )
22
23 func TestMetricsNilSupportsMetrics(t *testing.T) {
24 metrics := &MetricsNil{}
25 supported := metrics.SupportsMetrics()
26 if supported {
27 t.Error("Expected no support for metrics")
28 }
29 }
30
31 func TestMetricsNilGetCapacity(t *testing.T) {
32 metrics := &MetricsNil{}
33 actual, err := metrics.GetMetrics()
34 expected := &Metrics{}
35 if *actual != *expected {
36 t.Errorf("Expected empty Metrics, actual %v", *actual)
37 }
38 if err == nil {
39 t.Errorf("Expected error when calling GetMetrics, actual nil")
40 }
41 }
42
View as plain text