public void UT_Portal_categories()
        {
            var repo    = new mockPortalRepository();
            var service = new PortalCategoriesV1(repo);

            var resp = service.Exec(null, 0, 10);

            if (resp.list.Count != 1)
            {
                Assert.Fail("categories // fail 1");
            }

            if (resp.total != 1)
            {
                Assert.Fail("categories // fail 2");
            }

            if (resp.list[0].Id != 1)
            {
                Assert.Fail("categories // fail 3.1");
            }

            if (resp.list[0].Name != "teste")
            {
                Assert.Fail("categories // fail 3.2");
            }
        }
Exemple #2
0
        public void UT_Portal_products()
        {
            var repo    = new mockPortalRepository();
            var service = new PortalProductsV1(repo);

            var resp = service.Exec(null, 1, 1, 0, 10);

            if (resp.list.Count != 1)
            {
                Assert.Fail("products // fail 1");
            }
        }
Exemple #3
0
        public void UT_Portal_product()
        {
            var repo    = new mockPortalRepository();
            var service = new PortalProductV1(repo);

            var resp = service.Exec(null, null, 1);

            if (resp.Id != 1)
            {
                Assert.Fail("product // fail 1");
            }
        }
Exemple #4
0
        public void UT_Portal_productComment()
        {
            var repo    = new mockPortalRepository();
            var service = new PortalProductCommentV1(repo);

            if (!service.Exec(null,
                              new AuthenticatedUser()
            {
                Id = 1
            },
                              new NewProductComment {
                Comment = "hello"
            }))
            {
                Assert.Fail("productComment // fail 1");
            }
        }