Example #1
0
        public void HandleNullViewRenderMessageCollection(Metadata sut, ITabContext context)
        {
            context.TabStore.Setup(ds => ds.Get(typeof(ViewEngine.FindViews.Message).FullName)).Returns(new List<ViewEngine.FindViews.Message>());
            context.TabStore.Setup(ds => ds.Get(typeof(View.Render.Message).FullName)).Returns<List<View.Render.Message>>(null);

            Assert.DoesNotThrow(() => sut.GetData(context));
        }
Example #2
0
        public void ReturnResult(Metadata sut, ITabContext context, View.Render.Message renderMessage)
        { 
            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<MetadataItemModel>;

            Assert.NotNull(result);
            Assert.NotEmpty(result);
        }