예제 #1
0
        //[TestMethod]
        public void QPMetadataManagerGetContentAttributesByIdTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);
            var attrs    = instance.GetContentAttributes(293);

            Assert.IsNotNull(attrs);
            Assert.AreEqual(18, attrs.Count);

            foreach (var item in attrs)
            {
                if (item.ContentId != 293)
                {
                    Assert.Fail("ContentId is incorrect.");
                }
            }

            attrs = instance.GetContentAttributes(int.MaxValue);
            Assert.IsNotNull(attrs);
            Assert.AreEqual(0, attrs.Count);
        }
예제 #2
0
        //  [TestMethod]
        public void QPMetadataManagerGetContentAttributesByIdWithNullParametersTest2()
        {
            try
            {
                var instance = new QPMetadataManager(TestUtils.ConnectionString);
                instance.GetContentAttributes(0);
            }
            catch (ArgumentNullException ex)
            {
                Assert.IsInstanceOfType(ex, typeof(ArgumentNullException));
                Assert.AreEqual("Value cannot be null.\r\nParameter name: contentId", ex.Message);

                return;
            }

            Assert.Fail("The exception was not thrown.");
        }
예제 #3
0
        public void QPMetadataManagerGetContentAttributesByIdWithNullParametersTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttributes(0);
        }
예제 #4
0
        public void QPMetadataManagerGetContentAttributesNotExistsTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttributes(TestUtils.SiteName, "AbstractItem1");
        }
예제 #5
0
        public void QPMetadataManagerGetContentAttributesWithEmptyParametersTest3()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttributes(string.Empty, "AbstractItem");
        }
예제 #6
0
        public void QPMetadataManagerGetContentAttributesWithEmptyParametersTest2()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttributes(TestUtils.SiteName, string.Empty);
        }