Esempio n. 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())
}
Esempio n. 2
0
func TestTrueMaybe(t *testing.T) {
	result := lists.CreateBooleanResult(true)
	count := result.Count()
	assert.Equal(t, 1, count)
}
Esempio n. 3
0
func TestFalseMaybe(t *testing.T) {
	result := lists.CreateBooleanResult(false)
	count := result.Count()
	assert.Equal(t, 0, count)
}