Ejemplo n.º 1
0
        public void Articles_Data_Post_Insert_Test()
        {
            AuthorRefrence author = new AuthorRefrence(lastName: "test",
                                                       name: "test",
                                                       userName: "******"
                                                       );

            author.Id = 1;

            Category cat = new Category(name: "test", slug: "test", isParent: true, lineAge: "");

            cat.Id = 1;

            var model = new Post(title: "Test", sendDate: DateTime.Now,
                                 publishedDate: null, visitCount: 0, content: "test", description: "test", postImage: "test",
                                 slug: "test",
                                 authorId: 1, tagId: 1, categoryId: 1, author: author, category: cat)
            {
                Id = rep.GetNextId()
            };

            uni.BeginTransAction();

            EntityAction result = rep.Create(model);

            Assert.AreEqual(result, EntityAction.Added);
            uni.RollBack();
        }
Ejemplo n.º 2
0
        public void Articles_Data_Tag_Insert_Test()
        {
            var model = new Tag(name: "Test");

            model.Id = rep.GetNextId();
            uni.BeginTransAction();

            EntityAction result = rep.Create(model);

            Assert.AreEqual(result, EntityAction.Added);
            uni.RollBack();
        }
        public void Articles_Data_Category_Insert_Test()
        {
            var model = new Category(slug: "Test", name: "Test", isParent: true, lineAge: "");

            model.Id = rep.GetNextId();
            uni.BeginTransAction();

            EntityAction result = rep.Create(model);

            Assert.AreEqual(result, EntityAction.Added);
            uni.RollBack();
        }