示例#1
0
        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));
        }
示例#2
0
        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>>()));
        }
示例#3
0
        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);
        }
示例#4
0
 public void HaveProperName(Views sut)
 {
     Assert.Equal("Views", sut.Name);
 }
示例#5
0
 public void HaveHttpContextBase(Views sut)
 {
     Assert.Equal(typeof(HttpContextBase), sut.RequestContextType);
 }
示例#6
0
 public void ExecuteOnEndRequest(Views sut)
 {
     Assert.Equal(RuntimeEvent.EndRequest, sut.ExecuteOn);
 }
示例#7
0
 public void Construct(Views sut)
 {
     Assert.IsAssignableFrom<ITab>(sut);
     Assert.IsAssignableFrom<ITabSetup>(sut);
 }