Skip to content

Conversation

@WonyoungChoi
Copy link
Contributor

@WonyoungChoi WonyoungChoi commented Nov 8, 2021

Usage

            var eventChannel = new EventChannel("test_event_channel");
            eventChannel.SetStreamHandler(new EventStreamHandler(
                (args, sink) =>
                {
                    Console.WriteLine("OnListen!!");
                    counter = 0;
                    timer = new Timer(100);
                    timer.Elapsed += (sender, e) =>
                    {
                        sink.Success("TEST_EVENT " + counter++);
                    };
                    timer.Start();
                },
                (args) =>
                {
                    Console.WriteLine("OnCancel!!");
                    timer.Stop();
                }));

@WonyoungChoi WonyoungChoi marked this pull request as draft November 8, 2021 06:23
@WonyoungChoi WonyoungChoi changed the title Add EventChannel and related classes embedding/csharp: Add EventChannel and related classes Nov 8, 2021
@WonyoungChoi WonyoungChoi force-pushed the event-ch branch 2 times, most recently from cdd19f0 to 401dba1 Compare November 10, 2021 23:09
@WonyoungChoi WonyoungChoi marked this pull request as ready for review November 10, 2021 23:34
@WonyoungChoi WonyoungChoi requested a review from a team November 10, 2021 23:36
public void Registers_Stream_Handler()
{
var messenger = Substitute.For<IBinaryMessenger>();
var handler = Substitute.For<IEventStreamHandler>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using new EventStreamHandler() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test to ensure that the call is delivered properly to the BinaryMessenger. IMO, it is not necessary to create an EventStreamHandler instance directly. Test double is enough in this case.

Co-authored-by: Swift Kim <[email protected]>
Copy link
Member

@swift-kim swift-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

@WonyoungChoi WonyoungChoi merged commit e3807c4 into flutter-tizen:master Nov 17, 2021
@WonyoungChoi WonyoungChoi deleted the event-ch branch November 17, 2021 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants