public void HandleNullViewRenderMessageCollection(Views sut, ITabContext context) { context.TabStore.Setup(ds => ds.Get(typeof(IList<ViewEngine.FindViews.Message>).AssemblyQualifiedName)).Returns(new List<ViewEngine.FindViews.Message>()); context.TabStore.Setup(ds => ds.Get(typeof(IList<View.Render.Message>).AssemblyQualifiedName)).Returns<List<View.Render.Message>>(null); Assert.DoesNotThrow(() => sut.GetData(context)); }
public void SubscribeToViewMessageTypes(Views sut, ITabSetupContext context) { sut.Setup(context); context.MessageBroker.Verify(mb => mb.Subscribe(It.IsAny<Action<ViewEngine.FindViews.Message>>())); context.MessageBroker.Verify(mb => mb.Subscribe(It.IsAny<Action<View.Render.Message>>())); }
public void ReturnResult(Views sut, ITabContext context, View.Render.Arguments renderArgs, ViewEngine.FindViews.Message findViewMessage, View.Render.Message renderMessage) { context.TabStore.Setup(ds => ds.Contains(typeof(IList<ViewEngine.FindViews.Message>).AssemblyQualifiedName)).Returns(true); context.TabStore.Setup(ds => ds.Get(typeof(IList<ViewEngine.FindViews.Message>).AssemblyQualifiedName)).Returns(new List<ViewEngine.FindViews.Message> { findViewMessage }); context.TabStore.Setup(ds => ds.Contains(typeof(IList<View.Render.Message>).AssemblyQualifiedName)).Returns(true); context.TabStore.Setup(ds => ds.Get(typeof(IList<View.Render.Message>).AssemblyQualifiedName)).Returns(new List<View.Render.Message> { renderMessage }); var result = sut.GetData(context) as List<ViewsModel>; Assert.NotNull(result); Assert.NotEmpty(result); }
public void HaveProperName(Views sut) { Assert.Equal("Views", sut.Name); }
public void HaveHttpContextBase(Views sut) { Assert.Equal(typeof(HttpContextBase), sut.RequestContextType); }
public void ExecuteOnEndRequest(Views sut) { Assert.Equal(RuntimeEvent.EndRequest, sut.ExecuteOn); }
public void Construct(Views sut) { Assert.IsAssignableFrom<ITab>(sut); Assert.IsAssignableFrom<ITabSetup>(sut); }