Ejemplo n.º 1
0
        //[Test]
        public void Select_the_Something_property_from_list_test()
        {
            //arrange
            var product = new Product() {Something = 1};
            var list = new List<Product>()
                           {
                               product
                           };

            //act
            var item = Select_the_Something_property_from_list(list);

            //assert
            Assert.AreEqual(product.Something ,item.SingleOrDefault());
        }
Ejemplo n.º 2
0
        //[Test]
        public void Filter_the_products_where_something_is_equal_to_2_from_list_test()
        {
            //arrange
            var product = new Product() { Something = 2 };
            var list = new List<Product>()
                           {
                               product,
                               new Product(){Something = 1}
                           };

            //act
            var item = Filter_the_products_where_something_is_equal_to_2_from_list(list);

            //assert
            Assert.AreEqual(1, item.Count());
        }
Ejemplo n.º 3
0
        //[Test]
        public void Order_the_list_by_the_something_property_test()
        {
            //arrange
            var product = new Product() { Something = 2 };
            var list = new List<Product>()
                           {
                               product,
                               new Product(){Something = 1}
                           };

            //act
            IEnumerable<Product> item = Order_the_list_by_the_something_property(list);

            //assert
            Assert.AreEqual(list[0], item.FirstOrDefault());
            Assert.AreEqual(list[1], item.LastOrDefault());
        }