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); }
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); }
public void HaveADocumentationUri() { var timeline = new Timeline(); Assert.False(string.IsNullOrWhiteSpace(timeline.DocumentationUri)); }
public void BeNamedTrace() { var timeline = new Timeline(); Assert.Equal("Timeline", timeline.Name); }
public void UseDefaultLifeCycleSupport() { var timeline = new Timeline(); Assert.Equal(RuntimeEvent.EndRequest, timeline.ExecuteOn); }
public void HaveProperContextObjectType() { var timeline = new Timeline(); Assert.Null(timeline.RequestContextType); }