Exemplo n.º 1
0
        public void buildBoxWith2SearchEnginecon3y2ItemsTest()
        {
            //arrange
            SearchEngineBoxBuilder builder = new SearchEngineBoxBuilder();
            var model = new SearchResultModel();
            var item1 = new Post()
            {
                SocialNetworkName = "Twitter"
            };
            var item2 = new Post()
            {
                SocialNetworkName = "Twitter"
            };
            var item3 = new Post()
            {
                SocialNetworkName = "Twitter"
            };
            var item4 = new Post()
            {
                SocialNetworkName = "Facebook"
            };
            var item5 = new Post()
            {
                SocialNetworkName = "Facebook"
            };

            model.Items.AddRange(new List <Post>()
            {
                item1, item2, item3, item4, item5
            });
            //act
            builder.BuildBox(model);

            //assert
            model.StatBoxs.Count.Should().Be.EqualTo(1);
            model.StatBoxs[0].StatItems.Count.Should().Be.EqualTo(2);
            model.StatBoxs[0].StatItems[0].Title.Should().Be.EqualTo("Twitter");
            model.StatBoxs[0].StatItems[1].Title.Should().Be.EqualTo("Facebook");
            model.StatBoxs[0].StatItems[0].ValueText.Should().Be.EqualTo("60,00%");
            model.StatBoxs[0].StatItems[1].ValueText.Should().Be.EqualTo("40,00%");
        }
        public void buildBoxWith2SearchEnginecon3y2ItemsTest()
        {
            //arrange
            SearchEngineBoxBuilder builder = new SearchEngineBoxBuilder();
            var model = new SearchResultModel();
            var item1 = new Post() { SocialNetworkName = "Twitter" };
            var item2 = new Post() { SocialNetworkName = "Twitter" };
            var item3 = new Post() { SocialNetworkName = "Twitter" };
            var item4 = new Post() { SocialNetworkName = "Facebook" };
            var item5 = new Post() { SocialNetworkName = "Facebook" };
            model.Items.AddRange(new List<Post>() { item1, item2, item3, item4, item5 });
            //act
            builder.BuildBox(model);

            //assert
            model.StatBoxs.Count.Should().Be.EqualTo(1);
            model.StatBoxs[0].StatItems.Count.Should().Be.EqualTo(2);
            model.StatBoxs[0].StatItems[0].Title.Should().Be.EqualTo("Twitter");
            model.StatBoxs[0].StatItems[1].Title.Should().Be.EqualTo("Facebook");
            model.StatBoxs[0].StatItems[0].ValueText.Should().Be.EqualTo("60,00%");
            model.StatBoxs[0].StatItems[1].ValueText.Should().Be.EqualTo("40,00%");
        }
        private void BuildEnginesBox(SearchResultModel model)
        {
            var builder = new SearchEngineBoxBuilder();

            builder.BuildBox(model);
        }
 private void BuildEnginesBox(SearchResultModel model)
 {
     var builder = new SearchEngineBoxBuilder();
     builder.BuildBox(model);
 }