Unit tests for stream (using mocks)