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

            //act
            builder.ProcessItem(item1);
            builder.ProcessItem(item2);
            builder.ProcessItem(item3);
            builder.ProcessItem(item4);

            //assert
            builder.Engines.Count.Should().Be.EqualTo(2);
            builder.Engines[0].Counter.Should().Be.EqualTo(2);
            builder.Engines[1].Counter.Should().Be.EqualTo(2);
        }
        public void Process1ItemShouldIncrementCounterTest()
        {
            //arrange
            SearchEngineBoxBuilder builder = new SearchEngineBoxBuilder();
            var item1 = new Post(){SocialNetworkName = "Twitter"};
            //act
            builder.ProcessItem(item1);

            //assert
            builder.Engines.Count.Should().Be.EqualTo(1);
            builder.Engines[0].Name.Should().Be.EqualTo(item1.SocialNetworkName);
            builder.Engines[0].Counter.Should().Be.EqualTo(1);
        }
Exemplo n.º 3
0
        public void Process1ItemShouldIncrementCounterTest()
        {
            //arrange
            SearchEngineBoxBuilder builder = new SearchEngineBoxBuilder();
            var item1 = new Post()
            {
                SocialNetworkName = "Twitter"
            };

            //act
            builder.ProcessItem(item1);

            //assert
            builder.Engines.Count.Should().Be.EqualTo(1);
            builder.Engines[0].Name.Should().Be.EqualTo(item1.SocialNetworkName);
            builder.Engines[0].Counter.Should().Be.EqualTo(1);
        }
        public void Process2ItemFromFrom2EnginesShouldSetCounterTo2Test()
        {
            //arrange
            SearchEngineBoxBuilder builder = new SearchEngineBoxBuilder();
            var item1 = new Post() { SocialNetworkName = "Twitter" };
            var item2 = new Post() { SocialNetworkName = "Twitter" };
            var item3 = new Post() { SocialNetworkName = "Facebook" };
            var item4 = new Post() { SocialNetworkName = "Facebook" };
            //act
            builder.ProcessItem(item1);
            builder.ProcessItem(item2);
            builder.ProcessItem(item3);
            builder.ProcessItem(item4);

            //assert
            builder.Engines.Count.Should().Be.EqualTo(2);
            builder.Engines[0].Counter.Should().Be.EqualTo(2);
            builder.Engines[1].Counter.Should().Be.EqualTo(2);
        }