// 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.
using System;
using System.Collections.Generic;
using System.Linq;
using NuGet.Frameworks;
namespace NuGet.Test.Utility
{
///
/// Framework specific assets for a SimpleTestProjectContext
///
public class SimpleTestProjectFrameworkContext
{
///
/// Target framework
///
public NuGetFramework Framework { get; }
public string TargetAlias { get; set; }
///
/// Package dependencies.
///
public List PackageReferences { get; set; } = new List();
///
/// Package downloads. All the packages are added as exact versions.
///
public List PackageDownloads { get; set; } = new List();
///
/// Project dependencies.
///
public List ProjectReferences { get; set; } = new List();
///
/// Framework specific properties.
///
public Dictionary Properties { get; set; } = new Dictionary(StringComparer.OrdinalIgnoreCase);
///
/// Project framework assembly references.
///
public List FrameworkAssemblyReferences { get; set; } = new List();
public SimpleTestProjectFrameworkContext()
: this(NuGetFramework.Parse("net461"), Enumerable.Empty(), Enumerable.Empty())
{
}
public SimpleTestProjectFrameworkContext(NuGetFramework framework)
: this(framework, Enumerable.Empty(), Enumerable.Empty())
{
}
public SimpleTestProjectFrameworkContext(
NuGetFramework framework,
IEnumerable packageReferences)
: this(framework, packageReferences, Enumerable.Empty())
{
}
public SimpleTestProjectFrameworkContext(
NuGetFramework framework,
IEnumerable projectReferences)
: this(framework, Enumerable.Empty(), projectReferences)
{
}
public SimpleTestProjectFrameworkContext(
NuGetFramework framework,
IEnumerable packageReferences,
IEnumerable projectReferences)
{
Framework = framework;
PackageReferences.AddRange(packageReferences);
ProjectReferences.AddRange(projectReferences);
TargetAlias = framework.GetShortFolderName();
}
}
}