Exemplo n.º 1
0
 /// <summary>
 /// Creates a fictive test <see cref="Runner"/>.
 /// </summary>
 private static Runner CreateTestRunner()
 {
     return(new Runner
     {
         InterfaceUri = FeedTest.Test1Uri, Command = "run2", Bindings = { EnvironmentBindingTest.CreateTestBinding() },
         Versions = new VersionRange("1.0..!2.0"),
         Arguments = { "--arg" }
     });
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a fictive test <see cref="Implementation"/>.
 /// </summary>
 public static Implementation CreateTestImplementation()
 {
     return(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://0install.de/files/test/test.zip"), Size = 1024
                     },
                     new SingleFile {
                         Href = new Uri("http://0install.de/files/test/test.dat"), Size = 1024, Destination = "test.dat"
                     },
                     new RenameStep {
                         Source = "a", Destination = "b"
                     },
                     new RemoveStep {
                         Path = "c"
                     }
                 }
             }
         }
     });
 }
 /// <summary>
 /// Creates a fictive test <see cref="PackageImplementation"/>.
 /// </summary>
 internal static PackageImplementation CreateTestImplementation()
 {
     return(new PackageImplementation
     {
         Distributions = { "RPM" }, 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() }
     });
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a fictive test <see cref="Implementation"/>.
 /// </summary>
 public static Implementation CreateTestImplementation()
 {
     return(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() }
     });
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a fictive test <see cref="PackageImplementation"/>.
 /// </summary>
 public static PackageImplementation CreateTestPackageImplementation()
 {
     return(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",
         Stability = Stability.Developer,
         Dependencies =
         {
             new Dependency
             {
                 InterfaceUri = Test2Uri, Importance = Importance.Recommended,
                 Bindings ={ EnvironmentBindingTest.CreateTestBinding(),                OverlayBindingTest.CreateTestBinding(), ExecutableInVarTest.CreateTestBinding(), ExecutableInPathTest.CreateTestBinding() }
             }
         }
     });
 }