Exemple #1
0
    public async Task ResolveAsync_WithExistingPackage_ReturnsPackages()
    {
        // Arrange
        var repository = NugetRepository.FromSourceUrl(NugetRepositoryTests.TestNugetFeed);
        var provider   = new NuGetDependencyResolver(new AggregateNugetRepository(new[] { repository }));

        // Act
        var result = await provider.ResolveAsync(NugetRepositoryTests.TestPackageName);

        // Assert
        Assert.NotEmpty(result.FoundDependencies);
        Assert.Empty(result.NotFoundDependencies);
    }
Exemple #2
0
    public async Task ResolveAsync_WithNoPackage_ReturnsMissing()
    {
        // Arrange
        var repository = NugetRepository.FromSourceUrl(NugetRepositoryTests.TestNugetFeed);
        var provider   = new NuGetDependencyResolver(new AggregateNugetRepository(new[] { repository }));

        // Act
        var result = await provider.ResolveAsync("this.package.does.not.exist");

        // Assert
        Assert.NotEmpty(result.NotFoundDependencies);
        Assert.Empty(result.FoundDependencies);
    }