Exemplo n.º 1
0
        //  [TestMethod]
        public void QPMetadataManagerGetSiteIdTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);
            int id       = instance.GetSiteId(TestUtils.SiteName);

            Assert.AreEqual(35, id);
        }
Exemplo n.º 2
0
        //  [TestMethod]
        public void QPMetadataManagerGetSiteIdTest_NotExists()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);
            int siteId   = instance.GetSiteId("dsdsd");

            Assert.AreEqual(0, siteId);
        }
Exemplo n.º 3
0
        //  [TestMethod]
        public void QPMetadataManagerGetContentNameTest_NotExists()
        {
            var    instance = new QPMetadataManager(TestUtils.ConnectionString);
            string name     = instance.GetContentName(1);

            Assert.AreEqual("", name);
        }
Exemplo n.º 4
0
        //  [TestMethod]
        public void QPMetadataManagerGetContentNameTest()
        {
            var    instance = new QPMetadataManager(TestUtils.ConnectionString);
            string name     = instance.GetContentName(295);

            Assert.AreEqual("Culture", name);
        }
Exemplo n.º 5
0
        //  [TestMethod]
        public void QPMetadataManagerGetSiteNameTest()
        {
            var    instance = new QPMetadataManager(TestUtils.ConnectionString);
            string name     = instance.GetSiteName(35);

            Assert.AreEqual(TestUtils.SiteName, name);
        }
Exemplo n.º 6
0
        //  [TestMethod]
        public void QPMetadataManagerGetContentIdTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);
            int id       = instance.GetContentId(TestUtils.SiteName, "AbstractItem");

            Assert.AreEqual(293, id);
        }
Exemplo n.º 7
0
        //  [TestMethod]
        public void QPMetadataManagerConstructorTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            Assert.IsNotNull(instance);
            Assert.IsNotNull(instance.DbConnection);
            Assert.AreEqual(TestUtils.ConnectionString, instance.DbConnection.InstanceConnectionString);
        }
Exemplo n.º 8
0
        //  [TestMethod]
        public void QPMetadataManagerGetContentAttributeTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);
            var attr     = instance.GetContentAttribute(TestUtils.SiteName, "AbstractItem", "Name");

            Assert.IsNotNull(attr);
            Assert.AreEqual("Name", attr.Name);
            Assert.AreEqual(293, attr.ContentId);

            attr = instance.GetContentAttribute(TestUtils.SiteName, "AbstractItem", "Name1");
            Assert.IsNull(attr);
        }
Exemplo n.º 9
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.");
        }
Exemplo n.º 10
0
        //  [TestMethod]
        public void QPMetadataManagerGetContentAttributeWithEmptyParametersTest9()
        {
            try
            {
                var instance = new QPMetadataManager(TestUtils.ConnectionString);
                instance.GetContentAttribute(TestUtils.SiteName, "AbstractItem", string.Empty);
            }
            catch (ArgumentNullException ex)
            {
                Assert.IsInstanceOfType(ex, typeof(ArgumentNullException));
                Assert.AreEqual("Value cannot be null.\r\nParameter name: fieldName", ex.Message);

                return;
            }

            Assert.Fail("The exception was not thrown.");
        }
Exemplo n.º 11
0
        //  [TestMethod]
        public void QPMetadataManagerGetSiteNameTest_NotExists_CheckExceptionText()
        {
            try
            {
                var instance = new QPMetadataManager(TestUtils.ConnectionString);
                instance.GetSiteName(350);
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(Exception));
                Assert.AreEqual("Site (id = 350) is not found", ex.Message);

                return;
            }

            Assert.Fail("The exception was not thrown.");
        }
Exemplo n.º 12
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);
        }
Exemplo n.º 13
0
        public void QPMetadataManagerGetContentAttributeWithNullParametersTest4()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttribute(TestUtils.SiteName, null, "Name");
        }
Exemplo n.º 14
0
        public void QPMetadataManagerGetContentAttributesByIdWithNullParametersTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttributes(0);
        }
Exemplo n.º 15
0
        public void QPMetadataManagerGetContentIdWithNullParametersTest2()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentId(TestUtils.SiteName, null);
        }
Exemplo n.º 16
0
        public void QPMetadataManagerGetContentAttributesNotExistsTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttributes(TestUtils.SiteName, "AbstractItem1");
        }
Exemplo n.º 17
0
        public void QPMetadataManagerGetContentAttributesWithEmptyParametersTest3()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttributes(string.Empty, "AbstractItem");
        }
Exemplo n.º 18
0
        public void QPMetadataManagerGetContentAttributesWithEmptyParametersTest2()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttributes(TestUtils.SiteName, string.Empty);
        }
Exemplo n.º 19
0
        public void QPMetadataManagerGetSiteIdWithEmptyParametersTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetSiteId(string.Empty);
        }
Exemplo n.º 20
0
        public void QPMetadataManagerGetContentAttributeWithEmptyParametersTest5()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttribute(string.Empty, string.Empty, "Name");
        }
Exemplo n.º 21
0
        public void QPMetadataManagerGetSiteNameWithNullParametersTest()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetSiteName(0);
        }
Exemplo n.º 22
0
        public void QPMetadataManagerGetSiteNameTest_NotExists()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetSiteName(350);
        }
Exemplo n.º 23
0
        public void QPMetadataManagerGetContentIdWithNullParametersTest3()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentId(null, "AbstractItem");
        }
Exemplo n.º 24
0
        public void QPMetadataManagerGetContentAttributeWithNullParametersTest6()
        {
            var instance = new QPMetadataManager(TestUtils.ConnectionString);

            instance.GetContentAttribute(null, "AbstractItem", null);
        }