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)); }
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)); }
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)); }
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)); }
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)); }
private static FeedModel CreateModel(params Message[] messagesToProcess) { var model = new FeedModel(); foreach(var message in messagesToProcess) { model.Process(message); } return model; }
public void process_throws_when_message_is_null() { var model = new FeedModel(); Assert.Throws<ArgumentNullException>(() => model.Process(null)); }
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); }
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()); }
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)); }