Beispiel #1
0
        public void SortByName_Test()
        {
            db.Setup(x => x.Items.GetAll()).Returns(GetAllItems());

            List <ItemDTO> act = mapper.Map <List <ItemDTO> >(service.SortBy(BLLSortCriteria.NAME));
            var            exp = GetAllItems();

            Assert.NotNull(act);
            Assert.AreEqual(4, act.Count);
            Assert.AreEqual(exp[0].ItemId, act[0].ItemId);
            Assert.AreEqual(exp[0].ItemName, act[0].ItemName);
            Assert.AreEqual(exp[1].Price, act[1].Price);
            Assert.AreEqual(exp[1].CategoryId, act[1].CategoryId);
        }