Exemplo n.º 1
0
        public void ReturnEmptyWhenNoData(ITabContext context)
        {
            context.TabStore.Setup(x => x.Get(typeof(Glimpse.Core.Message.ITimelineMessage).FullName)).Returns((IEnumerable<Glimpse.Core.Message.ITimelineMessage>)null);

            var timeline = new Timeline();
            var result = timeline.GetData(context) as TimelineModel;

            Assert.NotNull(result);
            Assert.Equal(TimeSpan.FromMilliseconds(0), result.Duration);
            Assert.NotNull(result.Events);
        }
Exemplo n.º 2
0
        public void ReturnData(ITabContext context)
        { 
            context.TabStore.Setup(x => x.Contains(typeof(IList<Glimpse.Core.Message.ITimelineMessage>).AssemblyQualifiedName)).Returns(true);
            context.TabStore.Setup(x => x.Get(typeof(IList<Glimpse.Core.Message.ITimelineMessage>).AssemblyQualifiedName)).Returns(BuildMessages());

            var timeline = new Timeline();
            var result = timeline.GetData(context) as TimelineModel;

            Assert.NotNull(result);
            Assert.Equal(TimeSpan.FromMilliseconds(7), result.Duration);
            Assert.Equal(3, result.Events.Count);
            Assert.Equal("TestName1", result.Events[0].Title);
            Assert.Equal("TestName3", result.Events[1].Title);
            Assert.Equal("TestName2", result.Events[2].Title);
        }