MCPcopy Create free account
hub / github.com/ReactiveX/RxGo / Test_Observable_AverageInt

Function Test_Observable_AverageInt

observable_operator_test.go:158–166  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

156}
157
158func Test_Observable_AverageInt(t *testing.T) {
159 defer goleak.VerifyNone(t)
160 ctx, cancel := context.WithCancel(context.Background())
161 defer cancel()
162 Assert(ctx, t, testObservable(ctx, 1, 2, 3).AverageInt(), HasItem(2))
163 Assert(ctx, t, testObservable(ctx, 1, 20).AverageInt(), HasItem(10))
164 Assert(ctx, t, Empty().AverageInt(), HasItem(0))
165 Assert(ctx, t, testObservable(ctx, 1.1, 2.2, 3.3).AverageInt(), HasAnError())
166}
167
168func Test_Observable_AverageInt8(t *testing.T) {
169 defer goleak.VerifyNone(t)

Callers

nothing calls this directly

Calls 6

AssertFunction · 0.85
testObservableFunction · 0.85
HasItemFunction · 0.85
EmptyFunction · 0.85
HasAnErrorFunction · 0.85
AverageIntMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…