Beispiel #1
0
        public void TestGetListAttribute_Null()
        {
            SPListsProxy proxy = new SPListsProxy( SITE_URL );
            string attr = proxy.GetListAttribute( "Shared Documents", "NonExistandAttribute" );

            Assert.IsNotNull( attr );
            Assert.IsEmpty( attr );
        }
Beispiel #2
0
        public void TestGetListCollection( )
        {
            SPListsProxy proxy = new SPListsProxy( SITE_URL );
            SPListInfo[ ] lists = proxy.GetListCollection( );

            Assert.IsNotNull( lists );
            Assert.Greater( lists.Length, 0 );
        }
Beispiel #3
0
        public void TestGetListAttribute( )
        {
            SPListsProxy proxy = new SPListsProxy( SITE_URL );
            string attr = proxy.GetListAttribute( "Shared Documents", "Title" );

            Assert.IsNotNull( attr );
            Assert.AreNotEqual( 0, attr.Length );
            Assert.AreEqual( "Shared Documents", attr );
        }
Beispiel #4
0
 public void TestGetListContentTypes( )
 {
     SPListsProxy proxy = new SPListsProxy( SITE_URL );
     SPContentTypeInfo[ ] types = proxy.GetListContentTypes( "Shared Documents" );
     
     Assert.IsNotNull( types );
     Assert.AreEqual( 4, types.Length );
     Assert.AreEqual( types[ 0 ].Name, "CustomDocumentContentType1" );
     Assert.AreEqual( types[ 1 ].Name, "Document" );
     Assert.AreEqual( types[ 2 ].Name, "SimpleContentType" );
     Assert.AreEqual( types[ 3 ].Name, "Folder" );
 }
Beispiel #5
0
        public void TestGetList( )
        {
            Uri url = new Uri( SITE_URL );
            string host = url.Host;

            SPListsProxy proxy = new SPListsProxy( SITE_URL );
            Assert.IsNotNull( proxy );

            SPListInfo listInfo = proxy.GetList( url.LocalPath );
            Assert.IsNotNull( listInfo );
            Assert.AreEqual( "Shared Documents", listInfo.Name );
        }
Beispiel #6
0
        public void TestGetListContentType( )
        {
            SPListsProxy proxy = new SPListsProxy( SITE_URL );
            SPContentTypeInfo type = proxy.GetListContentType( "Shared Documents", null /*"0x01010"*/ );

            Assert.IsNotNull( type );
            Assert.IsTrue( type.IsValid( ) );
            Assert.AreEqual( "CustomDocumentContentType1", type.Name ); // the shared library is set up with a custom doc content type as the default
            Assert.IsTrue( type.Id.StartsWith( "0x01010" ) ); // Document derived content types always start with this number
            Assert.AreEqual( DOCLIB_URL, type.Scope );
            Assert.AreEqual( "CustomDocumentContentType1", type.Description );
            Assert.AreEqual( false, type.BestMatch );
        }
        private void buttonGetProfile_Click( object sender, EventArgs e )
        {
            SPListsProxy lists = new SPListsProxy( this.textBoxDocLibAddress.Text );
            string parent = lists.ParentListUrl;
            string docLib = lists.ListName;

            SPListsProxy parentList = new SPListsProxy( parent );
            SPContentTypeInfo[] contentTypes = parentList.GetListContentTypes( docLib );

            this.comboBoxContentTypes.Items.Clear( );
            foreach( SPContentTypeInfo contentType in contentTypes )
            {
                this.comboBoxContentTypes.Items.Add( contentType );
            }
        }
Beispiel #8
0
 public void TestGetDocumentID( )
 {
     SPListsProxy proxy = new SPListsProxy( SITE_URL );
     string id = proxy.GetDocumentID( "Shared Documents", "DocumentWithoutProperties.docx" );
     Assert.IsNotNull( id );
     Assert.AreEqual( "4", id );
 }
Beispiel #9
0
 public void TestListName( )
 {
     SPListsProxy proxy = new SPListsProxy( SITE_URL );
     Assert.AreEqual( "ContentTypeTests", proxy.ListName );
 }