public void TestGetContentType() { SPWebsProxy proxy = new SPWebsProxy(SITE_URL3); SPContentTypeInfo contentType = proxy.GetContentType("0x01010099BCFB0D7A03B54D8334579650ECE57E"); // you can get this ID by using proxy.GetContentTypes() and iterating through the results Assert.IsNotNull(contentType); Assert.AreEqual("CustomDocumentContentType1", contentType.Name); }
public void TestInit( ) { SPWebsProxy proxy = new SPWebsProxy( SITE_URL3 ); SPContentTypeInfo contentType = proxy.GetContentType( "0x01010099BCFB0D7A03B54D8334579650ECE57E" ); // you can get this ID by using proxy.GetContentTypes() and iterating through the results Assert.IsNotNull( contentType ); List<SPFieldInfo> fields = contentType.GetFields( ); Assert.IsNotNull( fields ); Assert.Greater( fields.Count, 0 ); Assert.IsNotNull( FindByName( fields, "Title" ) ); Assert.IsNotNull( FindByName( fields, "_Author" ) ); Assert.IsNotNull( FindByName( fields, "Birthday" ) ); Assert.IsNotNull( FindByName( fields, "CustomerID" ) ); Assert.IsNotNull( FindByName( fields, "Hobbies" ) ); }