Skip to content

Commit

Permalink
test: add a test case for Registry
Browse files Browse the repository at this point in the history
Signed-off-by: Shiwei Zhang <[email protected]>
  • Loading branch information
shizhMSFT committed Jan 4, 2024
1 parent 498a5d0 commit d2387be
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/OrasProject.Oras.Tests/RemoteTest/RegistryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace OrasProject.Oras.Tests.RemoteTest
{
public class RegistryTest
{

public static HttpClient CustomClient(Func<HttpRequestMessage, CancellationToken, HttpResponseMessage> func)
{
var moqHandler = new Mock<DelegatingHandler>();
Expand All @@ -36,6 +35,18 @@ public static HttpClient CustomClient(Func<HttpRequestMessage, CancellationToken
return new HttpClient(moqHandler.Object);
}

/// <summary>
/// Test registry constructor
/// </summary>
[Fact]
public void Registry()
{
var registryName = "foobar";
var registry = new Remote.Registry(registryName);
var options = registry.RepositoryOptions;
Assert.Equal(registryName, options.Reference.Registry);
}

/// <summary>
/// PingAsync tests the PingAsync method of the Registry class.
/// </summary>
Expand Down

0 comments on commit d2387be

Please sign in to comment.