Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 3
0
        public void HaveADocumentationUri()
        {
            var timeline = new Timeline();

            Assert.False(string.IsNullOrWhiteSpace(timeline.DocumentationUri));
        }
Ejemplo n.º 4
0
 public void BeNamedTrace()
 {
     var timeline = new Timeline();
     Assert.Equal("Timeline", timeline.Name);
 }
Ejemplo n.º 5
0
 public void UseDefaultLifeCycleSupport()
 {
     var timeline = new Timeline();
     Assert.Equal(RuntimeEvent.EndRequest, timeline.ExecuteOn);
 }
Ejemplo n.º 6
0
        public void HaveProperContextObjectType()
        {
            var timeline = new Timeline();

            Assert.Null(timeline.RequestContextType);
        }