Example #1
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"
                     }
                 }
             }
         }
     });
 }
Example #2
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() }
             }
         }
     });
 }