コード例 #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);
        }