Esempio n. 1
0
        public void SearchSuppliersTest()
        {
            // ACT
            IHttpActionResult actionResult = _suppliersController.SearchSuppliers("rue");
            var contentResult = actionResult as OkNegotiatedContentResult <IOrderedQueryable <Supplier> >;

            // ASSERT
            Assert.IsNotNull(contentResult);
            Assert.IsNotNull(contentResult.Content);
            Assert.AreEqual(5, contentResult.Content.Count());
        }
        public void SearchSuppliersTest()
        {
            // ACT
            //IHttpActionResult actionResult = _suppliersController.SearchSuppliers("rue");
            //var contentResult = actionResult as OkNegotiatedContentResult<IQueryable<Supplier>>;
            dynamic contentResult = _suppliersController.SearchSuppliers("rue");
            var     list          = ((IEnumerable <dynamic>)contentResult.Content).ToList();

            // ASSERT
            Assert.IsNotNull(contentResult);
            Assert.IsNotNull(contentResult.Content);
            Assert.AreEqual(list.Count, 5);
        }