// GET /api/hostedservice/subscriptionId/certificateBytes/serviceName public HostedService Get(string subscriptionId, List<Byte> certificateBytes, string serviceName) { HostedService hostedService = null; try { HostedServiceHelper hostedServiceHelper = new HostedServiceHelper(); hostedService = hostedServiceHelper.GetHostedService(subscriptionId, certificateBytes, serviceName); } catch (Exception ex) { Logger.Write(string.Format("Error occurred in HostedServiceController.Get(string subscriptionId, Byte[] certificateBytes, string serviceName) Error: {0}", ex.Message)); hostedService = null; } return hostedService; }
public void GetHostedServiceTest() { HostedServiceHelper target = new HostedServiceHelper(); string subscriptionId = "32e65da4-1eaf-4073-940a-51d7357d321b"; string filePath = @"C:\Development\Certificates\AzureManagementCertificate.cer"; List<Byte> certificateBytes = CertificateUtility.GetCertificateBytes(filePath); string serviceName = "evoappweb"; HostedService expected = null; HostedService actual; actual = target.GetHostedService(subscriptionId, certificateBytes, serviceName); Assert.AreEqual(expected, actual); }