Ejemplo n.º 1
0
        public void FromEntityList_should_return_empty_list_when_entity_list_is_null()
        {
            var productList = new ProductListItem().FromEntityList(null);

            Assert.That(productList, Is.Not.Null);
            Assert.That(productList.Any(), Is.False);
        }
Ejemplo n.º 2
0
        public void FromEntityList_should_return_empty_list_when_entity_list_contains_no_entities()
        {
            var productEntityList = new List <Product>();

            var productList = new ProductListItem().FromEntityList(productEntityList);

            Assert.That(productList, Is.Not.Null);
            Assert.That(productList.Any(), Is.False);
        }
Ejemplo n.º 3
0
        public void FromEntityList_should_map_properties_when_entity_list_contains_entities()
        {
            var productEntityList = Fakes.FakeProductList();

            var productList = new ProductListItem().FromEntityList(productEntityList);

            Assert.That(productList, Is.Not.Null);
            Assert.That(productList.Any(), Is.True);
            Assert.That(productList[0].Name, Is.EqualTo(productEntityList.ToList()[0].Name));
        }