public void GetAllTest()
        {
            var testProducts = this.GetTestProducts();
            var productRepositoryMock = Mock.Of<IProductsRepository>(R => R.GetAll() == testProducts);

            var productsController = new ProductsController(productRepositoryMock);
            var allProducts = productsController.Get();

            Assert.That(allProducts, Is.Not.Empty);
            Assert.That(allProducts.Count(), Is.EqualTo(testProducts.Count));
        }
        public void GetByIdTest()
        {
            var testProducts = this.GetTestProducts();
            var productId = testProducts.First().Id;

            var productRepositoryMock = new Mock<IProductsRepository>();
            productRepositoryMock.Setup(R => R.GetById(productId)).Returns(testProducts.First(P => P.Id == productId));

            var productsController = new ProductsController(productRepositoryMock.Object);

            var result = productsController.Get(productId) as OkNegotiatedContentResult<Product>;

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Content, Is.Not.Null);
            Assert.That(result.Content.Id,Is.EqualTo(productId));
        }