mirror of
https://github.com/aphrody-labs/NuGet.Client.git
synced 2026-10-14 13:29:05 +00:00
33 lines
921 B
C#
33 lines
921 B
C#
// Copyright (c) .NET Foundation. All rights reserved.
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
#nullable disable
|
|
|
|
using System;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
|
|
namespace Test.Utility
|
|
{
|
|
public static class ProtocolUtility
|
|
{
|
|
public static string GetResource(string name, Type type)
|
|
{
|
|
using (var reader = new StreamReader(type.Assembly.GetManifestResourceStream(name)))
|
|
{
|
|
return reader.ReadToEnd();
|
|
}
|
|
}
|
|
|
|
public static string CreateServiceAddress()
|
|
{
|
|
return string.Format(CultureInfo.InvariantCulture, "http://{0}/", Guid.NewGuid());
|
|
}
|
|
|
|
public static string CreateHttpsServiceAddress()
|
|
{
|
|
return string.Format(CultureInfo.InvariantCulture, "https://{0}/", Guid.NewGuid());
|
|
}
|
|
}
|
|
}
|