コード例 #1
0
        public void get_invokes_product_service_get_all(
            [Frozen] IProductService service,
            ProductController sut)
        {
            sut.Get();

            service.Received()
                .GetAllProducts();
        }
コード例 #2
0
        public void get_returns_list_of_all_stored_products(
            [Frozen] IProductService service,
            ProductController sut)
        {
            var products = new ProductDataFactory()
                .CreateManyProducts();

            service.GetAllProducts()
                .Returns(products);

            sut.Get()
                .ShouldAllBeEquivalentTo(products);
        }
コード例 #3
0
        public void get_page_products_returns_list_of_10_products(
            [Frozen] IProductService service,
            ProductController sut)
        {
            var products = new ProductDataFactory()
                .CreateProductsList(10);

            service.GetProductsForPage(1)
                .Returns(products);

            sut.GetPageProducts(1)
                .ShouldAllBeEquivalentTo(products);
        }