// [TestMethod] public void QPMetadataManagerGetSiteIdTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); int id = instance.GetSiteId(TestUtils.SiteName); Assert.AreEqual(35, id); }
// [TestMethod] public void QPMetadataManagerGetSiteIdTest_NotExists() { var instance = new QPMetadataManager(TestUtils.ConnectionString); int siteId = instance.GetSiteId("dsdsd"); Assert.AreEqual(0, siteId); }
// [TestMethod] public void QPMetadataManagerGetContentNameTest_NotExists() { var instance = new QPMetadataManager(TestUtils.ConnectionString); string name = instance.GetContentName(1); Assert.AreEqual("", name); }
// [TestMethod] public void QPMetadataManagerGetContentNameTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); string name = instance.GetContentName(295); Assert.AreEqual("Culture", name); }
// [TestMethod] public void QPMetadataManagerGetSiteNameTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); string name = instance.GetSiteName(35); Assert.AreEqual(TestUtils.SiteName, name); }
// [TestMethod] public void QPMetadataManagerGetContentIdTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); int id = instance.GetContentId(TestUtils.SiteName, "AbstractItem"); Assert.AreEqual(293, id); }
// [TestMethod] public void QPMetadataManagerConstructorTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); Assert.IsNotNull(instance); Assert.IsNotNull(instance.DbConnection); Assert.AreEqual(TestUtils.ConnectionString, instance.DbConnection.InstanceConnectionString); }
// [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); }
// [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."); }
// [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."); }
// [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."); }
//[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); }
public void QPMetadataManagerGetContentAttributeWithNullParametersTest4() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentAttribute(TestUtils.SiteName, null, "Name"); }
public void QPMetadataManagerGetContentAttributesByIdWithNullParametersTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentAttributes(0); }
public void QPMetadataManagerGetContentIdWithNullParametersTest2() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentId(TestUtils.SiteName, null); }
public void QPMetadataManagerGetContentAttributesNotExistsTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentAttributes(TestUtils.SiteName, "AbstractItem1"); }
public void QPMetadataManagerGetContentAttributesWithEmptyParametersTest3() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentAttributes(string.Empty, "AbstractItem"); }
public void QPMetadataManagerGetContentAttributesWithEmptyParametersTest2() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentAttributes(TestUtils.SiteName, string.Empty); }
public void QPMetadataManagerGetSiteIdWithEmptyParametersTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetSiteId(string.Empty); }
public void QPMetadataManagerGetContentAttributeWithEmptyParametersTest5() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentAttribute(string.Empty, string.Empty, "Name"); }
public void QPMetadataManagerGetSiteNameWithNullParametersTest() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetSiteName(0); }
public void QPMetadataManagerGetSiteNameTest_NotExists() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetSiteName(350); }
public void QPMetadataManagerGetContentIdWithNullParametersTest3() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentId(null, "AbstractItem"); }
public void QPMetadataManagerGetContentAttributeWithNullParametersTest6() { var instance = new QPMetadataManager(TestUtils.ConnectionString); instance.GetContentAttribute(null, "AbstractItem", null); }