Process() public method

public Process ( Message message ) : void
message Message
return void
示例#1
0
        public void changes_to_the_last_message_received_on_property_raise_the_property_changed_event()
        {
            var model = new FeedModel();
            var observer = model.CreateObserver();

            model.Process(new SetStreamValidityMessage(false));
            Assert.True(observer.HasChanged(x => x.LastMessageReceivedOn));
        }
示例#2
0
        public void changes_to_the_copyright_property_raise_the_property_changed_event()
        {
            var model = new FeedModel();
            var observer = model.CreateObserver();

            model.Process(new SetCopyrightMessage("1"));
            Assert.True(observer.HasChanged(x => x.Copyright));
        }
示例#3
0
        public void changes_to_the_keyframe_property_raise_the_property_changed_event()
        {
            var model = new FeedModel();
            var observer = model.CreateObserver();

            model.Process(new SetKeyframeMessage(1));
            Assert.True(observer.HasChanged(x => x.KeyframeNumber));
        }
示例#4
0
        public void changes_to_the_ping_interval_property_raise_the_property_changed_event()
        {
            var model = new FeedModel();
            var observer = model.CreateObserver();

            model.Process(new SetPingIntervalMessage(TimeSpan.FromSeconds(1D)));
            Assert.True(observer.HasChanged(x => x.PingInterval));
        }
示例#5
0
        public void changes_to_the_message_count_property_raise_the_property_changed_event()
        {
            var model = new FeedModel();
            var observer = model.CreateObserver();

            model.Process(new SetStreamValidityMessage(false));
            Assert.True(observer.HasChanged(x => x.MessageCount));
        }
示例#6
0
        private static FeedModel CreateModel(params Message[] messagesToProcess)
        {
            var model = new FeedModel();

            foreach(var message in messagesToProcess)
            {
                model.Process(message);
            }

            return model;
        }
示例#7
0
        public void process_throws_when_message_is_null()
        {
            var model = new FeedModel();

            Assert.Throws<ArgumentNullException>(() => model.Process(null));
        }
示例#8
0
        public void processing_a_message_updates_the_message_count_property()
        {
            var model = new FeedModel();

            Assert.Equal(0, model.MessageCount);
            model.Process(new SetStreamValidityMessage(false));
            Assert.Equal(1, model.MessageCount);
            model.Process(new SetStreamValidityMessage(false));
            Assert.Equal(2, model.MessageCount);
        }
示例#9
0
        public void processing_a_message_updates_the_last_message_received_on_property()
        {
            var model = new FeedModel();

            model.Process(new SetStreamValidityMessage(false));
            Assert.InRange(model.LastMessageReceivedOn.Value, SysClock.Now().AddMilliseconds(-5), SysClock.Now());
        }
示例#10
0
        public void changes_to_the_timestamp_property_raise_the_property_changed_event()
        {
            var model = new FeedModel();
            var observer = model.CreateObserver();

            model.Process(new SetStreamTimestampMessage());
            Assert.True(observer.HasChanged(x => x.Timestamp));
        }