public void EncryptedDataCanBeSetAndRetrieved()
 {
     var request = new ListPackagesResponse();
     var packages = new List<PackageDetails>();
     request.Packages = packages;
     Assert.AreEqual(packages, request.Packages);
 }
 public void RequestConstructorInitialisesTheValues()
 {
     var request = new EncryptedRequest();
     var response = new ListPackagesResponse(request);
     // Only check one property is set, since the properties are set by the base class
     Assert.AreEqual(request.Identifier, response.RequestIdentifier);
 }
 public void FullConstructorInitialisesTheValues()
 {
     var response1 = new ListPackagesResponse();
     response1.RequestIdentifier = "12345";
     var response2 = new ListPackagesResponse(response1);
     // Only check one property is set, since the properties are set by the base class
     Assert.AreEqual(response1.RequestIdentifier, response2.RequestIdentifier);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Retrieves the latest list of packages for a project.
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public virtual ListPackagesResponse RetrievePackageList(ProjectRequest request)
 {
     List<PackageDetails> packages = null;
     ListPackagesResponse response = new ListPackagesResponse(RunProjectRequest(request,
         SecurityPermission.ViewProject,
         null,
         delegate
         {
             if (request is BuildRequest)
             {
                 var actualRequest = request as BuildRequest;
                 packages = GetIntegrator(request.ProjectName).Project.RetrievePackageList(actualRequest.BuildName);
             }
             else
             {
                 packages = GetIntegrator(request.ProjectName).Project.RetrievePackageList();
             }
         }));
     response.Packages = packages;
     return response;
 }