Microsoft.Protocols.TestSuites.MS_COPYS.S02_CopyIntoItemsLocal.MSCOPYS_S02_TC02_CopyIntoItemsLocal_DestinationInvalid C# (CSharp) Method

MSCOPYS_S02_TC02_CopyIntoItemsLocal_DestinationInvalid() private method

        public void MSCOPYS_S02_TC02_CopyIntoItemsLocal_DestinationInvalid()
        {
            // Get resource from properties,normal source file and normal destination library.
            string sourceFileUrlOnDesSut = this.GetSourceFileUrl(SourceFileUrlType.SourceFileOnDesSUT);

            // Get the first destination location.
            string desFileUrl1 = this.GetDestinationFileUrl(DestinationFileUrlType.NormalDesLibraryOnDesSUT);

            // Get a folder location that is not valid on the destination server. 
            string desFileUrl = this.GenerateInvalidFolderPathForFileUrl(desFileUrl1);      
            string[] desUrls = new string[] { desFileUrl };

            // Copy files in same SUT with the invalid destination folder.
            CopyIntoItemsLocalResponse copyIntoItemsLocalResponse = MSCopysAdapter.CopyIntoItemsLocal(
                                                                                    sourceFileUrlOnDesSut,
                                                                                    desUrls);

            this.Site.Assert.IsNotNull(copyIntoItemsLocalResponse.Results, "The element Results should be return if CopyIntoItemsLocal operation executes successfully");
            this.Site.Assert.IsTrue(1 == copyIntoItemsLocalResponse.Results.Length, "The Results element should contain one CopyResult element.");

            // Verify MS-COPYS requirement: MS-COPYS_R92
            this.Site.CaptureRequirementIfAreEqual<CopyErrorCode>(
                CopyErrorCode.DestinationInvalid,
                copyIntoItemsLocalResponse.Results[0].ErrorCode,
                92,
                @"[In CopyErrorCode] DestinationInvalid: This value is used to indicate  the destination location points to 
                a folder location that is not valid on the destination server.");

            // Verify MS-COPYS requirement: MS-COPYS_R279
            this.Site.CaptureRequirementIfAreEqual<CopyErrorCode>(
                CopyErrorCode.DestinationInvalid,
                copyIntoItemsLocalResponse.Results[0].ErrorCode,
                279,
                @"[In CopyIntoItemsLocal] [If the source location and the destination location refer to different protocol servers, or ]if the destination location points to a non-existing folder, the protocol server MUST report a failure by returning the CopyResult element with the ErrorCode attribute set to ""DestinationInvalid"".");
        }