Ejemplo n.º 1
0
        public void FilterBySmallReturn2()
        {
            // arrange
            ProductFilter filter = new ProductFilter();
            IList<Product> products = BuildProducts();

            // act
            var result = filter.By(products,  new SpecificationSize(Size.Small));

            // assert
            Assert.That(result.Count(), Is.EqualTo(2));
            Assert.That(result, Has.All.Matches<Product>(x => x.Size == Size.Small));
        }
Ejemplo n.º 2
0
        public void FilterByBlueReturn2()
        {
            // arrange
            ProductFilter filter = new ProductFilter();
            IList<Product> products = BuildProducts();

            // act
            var result = filter.By(products, new SpecificationColor(Color.Blue));

            // assert
            Assert.That(result.Count(), Is.EqualTo(2));
            Assert.That(result, Has.All.Matches<Product>(x => x.Color == Color.Blue));
        }
Ejemplo n.º 3
0
        public void FilterByBlueReturn2()
        {
            // arrange
            ProductFilter   filter   = new ProductFilter();
            IList <Product> products = this.BuildProducts();

            // act
            var result = filter.By(products, new SpecificationColor(Color.Blue));

            // assert
            Assert.That(result.Count(), Is.EqualTo(2));
            Assert.That(result, Has.All.Matches <Product>(x => x.Color == Color.Blue));
        }
Ejemplo n.º 4
0
        public void FilterByBlueAndSmallReturn1()
        {
            // arrange
            ProductFilter   filter   = new ProductFilter();
            IList <Product> products = this.BuildProducts();

            // act
            var result = filter.By(products, new SpecificationColorAndSize(Color.Blue, Size.Small));

            // assert
            Assert.That(result.Count(), Is.EqualTo(1));
            Assert.That(result, Has.All.Matches <Product>(x => x.Size == Size.Small));
        }
Ejemplo n.º 5
0
        public void FilterByBlueAndSmallReturn1()
        {
            // arrange
            ProductFilter filter = new ProductFilter();
            IList<Product> products = this.BuildProducts();

            // act
            var result = filter.By(products, new SpecificationColorAndSize(Color.Blue, Size.Small));

            // assert
            Assert.That(result.Count(), Is.EqualTo(1));
            Assert.That(result, Has.All.Matches<Product>(x => x.Size == Size.Small));
        }