示例#1
0
 /// <summary>
 /// Creates a fictive test <see cref="Runner"/>.
 /// </summary>
 private static Runner CreateTestRunner() => new Runner
 {
     InterfaceUri = FeedTest.Test1Uri,
     Command      = "run2",
     Bindings     = { EnvironmentBindingTest.CreateTestBinding() },
     Versions     = new VersionRange("1.0..!2.0"),
     Arguments    = { "--arg" }
 };
 /// <summary>
 /// Creates a fictive test <see cref="PackageImplementation"/>.
 /// </summary>
 internal static PackageImplementation CreateTestImplementation() => new PackageImplementation
 {
     Distributions = { "RPM" },
     Version       = new VersionRange("1..!2"),
     Architecture  = new Architecture(OS.Windows, Cpu.I586),
     Languages     = { "en-US" },
     Main          = "executable",
     DocDir        = "doc",
     Bindings      = { EnvironmentBindingTest.CreateTestBinding() }
 };
示例#3
0
 /// <summary>
 /// Creates a fictive test <see cref="Implementation"/>.
 /// </summary>
 public static Implementation CreateTestImplementation() => new Implementation
 {
     ID             = "id1",
     ManifestDigest = new ManifestDigest(sha256: "123"),
     Version        = new ImplementationVersion("1.0"),
     Architecture   = new Architecture(OS.Windows, Cpu.I586),
     Languages      = { "en-US" },
     Commands       = { CommandTest.CreateTestCommand1() },
     DocDir         = "doc",
     Stability      = Stability.Developer,
     Dependencies   =
     {
         new Dependency
         {
             InterfaceUri = Test1Uri,
             Constraints  = { new Constraint {
                                  NotBefore = new ImplementationVersion("1.0"), Before = new ImplementationVersion("2.0")
                              } },
             Bindings ={ EnvironmentBindingTest.CreateTestBinding(), OverlayBindingTest.CreateTestBinding(), ExecutableInVarTest.CreateTestBinding(), ExecutableInPathTest.CreateTestBinding() }
         }
     },
     Restrictions =
     {
         new Restriction
         {
             InterfaceUri = Test2Uri,
             Constraints  = { new Constraint {
                                  Before = new ImplementationVersion("2.0")
                              } }
         }
     },
     RetrievalMethods =
     {
         new Recipe
         {
             Steps =
             {
                 new Archive    {
                     Href = new Uri("http://example.com/test.zip"), Size = 1024
                 },
                 new SingleFile {
                     Href = new Uri("http://example.com/test.dat"), Size = 1024, Destination = "test.dat"
                 },
                 new RenameStep {
                     Source = "a", Destination = "b"
                 },
                 new RemoveStep {
                     Path = "c"
                 }
             }
         }
     }
 };
示例#4
0
 /// <summary>
 /// Creates a fictive test <see cref="Implementation"/>.
 /// </summary>
 public static Implementation CreateTestImplementation() => new Implementation
 {
     ID               = "id",
     ManifestDigest   = new ManifestDigest(sha256: "123"),
     Version          = new ImplementationVersion("1.0"),
     Architecture     = new Architecture(OS.Windows, Cpu.I586),
     Languages        = { "en-US" },
     Main             = "executable",
     DocDir           = "doc",
     Stability        = Stability.Developer,
     Bindings         = { EnvironmentBindingTest.CreateTestBinding() },
     RetrievalMethods = { ArchiveTest.CreateTestArchive(), new Recipe {
                              Steps = { ArchiveTest.CreateTestArchive() }
                          } },
     Commands = { CommandTest.CreateTestCommand1() }
 };
示例#5
0
 /// <summary>
 /// Creates a fictive test <see cref="PackageImplementation"/>.
 /// </summary>
 public static PackageImplementation CreateTestPackageImplementation() => new PackageImplementation
 {
     Package       = "firefox",
     Distributions = { "RPM" },
     Version       = new ImplementationVersion("1.0"),
     Architecture  = new Architecture(OS.Windows, Cpu.I586),
     Languages     = { "en-US" },
     Commands      = { CommandTest.CreateTestCommand1() },
     DocDir        = "doc",
     Dependencies  =
     {
         new Dependency
         {
             InterfaceUri = Test2Uri,
             Importance   = Importance.Recommended,
             Bindings     = { EnvironmentBindingTest.CreateTestBinding(), OverlayBindingTest.CreateTestBinding(), ExecutableInVarTest.CreateTestBinding(), ExecutableInPathTest.CreateTestBinding() }
         }
     }
 };