public void TestGetProperty( ) { string filename = Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute( @"Test Files\Workshare.Connect.SharePoint.Common.Tests\ThisDocHasProperties.doc" ); CustomPropResolver resolver = new CustomPropResolver( filename ); Assert.IsNotNull( resolver.GetProperty( "Prop1" ) ); Assert.IsNotNull( resolver.GetProperty( "Prop2" ) ); }
public void TestGetUrl( ) { CustomPropResolver resolver = new CustomPropResolver( FILE_PATH + "Doc_Out_CheckOutSrcUrl.doc" ); string s = resolver.GetUrl( ); Assert.IsNotNull( s ); Assert.IsNotEmpty( s ); // the prop should contain a path to where the original document was checked out Assert.IsTrue( s.ToLower( ).IndexOf( ".doc" ) != -1 ); }
public void TestCanResolve_Doc( ) { //documents have _CheckOutSrcUrl custom property { CustomPropResolver resolver = new CustomPropResolver( Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute( @"Test Files\Workshare.Connect.SharePoint.Common.Tests\Doc_With_CheckOutSrcUrl.doc" ) ); Assert.IsTrue( resolver.CanResolve( ) ); } //documents _don't_ have _CheckOutSrcUrl custom property { CustomPropResolver resolver = new CustomPropResolver( Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute( @"Test Files\Workshare.Connect.SharePoint.Common.Tests\Doc_WithOut_CheckOutSrcUrl.doc" ) ); Assert.IsFalse( resolver.CanResolve( ) ); } }
public void TestCanResolve_Docx( ) { //Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute( @"Test Files\Workshare.Connect.SharePoint.Common.Tests\Docx_With_CheckOutSrcUrl.docx" ) const string filename = @"C:\Documents and Settings\iainb\My Documents\SharePoint Drafts\deltaview original DOCX.docx"; //documents have _CheckOutSrcUrl custom property { CustomPropResolver resolver = new CustomPropResolver( filename ); Assert.IsTrue( resolver.CanResolve( ) ); } //documents _don't_ have _CheckOutSrcUrl custom property { CustomPropResolver resolver = new CustomPropResolver( filename ); Assert.IsFalse( resolver.CanResolve( ) ); } }