Пример #1
0
func TestMaybeFlatmap(t *testing.T) {
	lst := lists.NewList([]lists.Maybe{
		lists.CreateBooleanResult(true),
		lists.CreateBooleanResult(false),
		lists.CreateBooleanResult(true),
	}).FlatMap()
	assert.Equal(t, 2, lst.Count())
}
Пример #2
0
func TestTrueMaybe(t *testing.T) {
	result := lists.CreateBooleanResult(true)
	count := result.Count()
	assert.Equal(t, 1, count)
}
Пример #3
0
func TestFalseMaybe(t *testing.T) {
	result := lists.CreateBooleanResult(false)
	count := result.Count()
	assert.Equal(t, 0, count)
}