public void TestProductsControllerGetByIdReturnsNotFound()
        {
            ProductsController ctrl = new ProductsController(_mockedRepository.Object);
            IHttpActionResult actionResult = ctrl.Get(999);

            // Assert
            Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult));
        }
        public void TestProductsControllerGetAll()
        {
            ProductsController ctrl = new ProductsController(_mockedRepository.Object);

            var products = ctrl.Get();

            Assert.IsInstanceOfType(products, typeof (OkNegotiatedContentResult<IList<Product>>));
        }
        public void TestProductsControllerGetById()
        {
            ProductsController ctrl = new ProductsController(_mockedRepository.Object);
            IHttpActionResult actionResult = ctrl.Get(3);
            var contentResult = actionResult as OkNegotiatedContentResult<Product>;

            // Assert
            Assert.IsNotNull(contentResult);
            Assert.IsNotNull(contentResult.Content);
            Assert.AreEqual(3, contentResult.Content.ProductId);
        }