Example #1
0
        public void WritesRuntimeTargetForNonPortable()
        {
            var result = Save(Create(
                                  "Target",
                                  "runtime",
                                  false,
                                  runtimeLibraries: new[]
            {
                new RuntimeLibrary(
                    "package",
                    "PackageName",
                    "1.2.3",
                    "HASH",
                    new [] { RuntimeAssembly.Create("Banana.dll") },
                    new ResourceAssembly[] {},
                    new RuntimeTarget[] {},
                    new [] {
                    new Dependency("Fruits.Abstract.dll", "2.0.0")
                },
                    true
                    ),
            }));

            // targets
            var targets      = result.Should().HavePropertyAsObject("targets").Subject;
            var target       = targets.Should().HavePropertyAsObject("Target/runtime").Subject;
            var library      = target.Should().HavePropertyAsObject("PackageName/1.2.3").Subject;
            var dependencies = library.Should().HavePropertyAsObject("dependencies").Subject;

            dependencies.Should().HavePropertyValue("Fruits.Abstract.dll", "2.0.0");
            library.Should().HavePropertyAsObject("runtime")
            .Subject.Should().HaveProperty("Banana.dll");

            //libraries
            var libraries = result.Should().HavePropertyAsObject("libraries").Subject;

            library = libraries.Should().HavePropertyAsObject("PackageName/1.2.3").Subject;
            library.Should().HavePropertyValue("sha512", "HASH");
            library.Should().HavePropertyValue("type", "package");
            library.Should().HavePropertyValue("serviceable", true);
        }
Example #2
0
        public void TrimsDotNiFromDllNames()
        {
            var assembly = RuntimeAssembly.Create("path/to/System.Collections.ni.dll");

            assembly.Name.Name.Should().Be("System.Collections");
        }
Example #3
0
        public void MergesRuntimeAndCompileLibrariesForPortable()
        {
            var result = Save(Create(
                                  "Target",
                                  "runtime",
                                  true,
                                  compileLibraries: new[]
            {
                new CompilationLibrary(
                    "package",
                    "PackageName",
                    "1.2.3",
                    "HASH",
                    new [] { "ref/Banana.dll" },
                    new [] {
                    new Dependency("Fruits.Abstract.dll", "2.0.0")
                },
                    true
                    )
            },
                                  runtimeLibraries: new[]
            {
                new RuntimeLibrary(
                    "package",
                    "PackageName",
                    "1.2.3",
                    "HASH",
                    new [] { RuntimeAssembly.Create("Banana.dll") },
                    new ResourceAssembly[] {},
                    new []
                {
                    new RuntimeTarget("win7-x64",
                                      new [] { RuntimeAssembly.Create("Banana.Win7-x64.dll") },
                                      new [] { "Banana.Win7-x64.so" }
                                      )
                },
                    new [] {
                    new Dependency("Fruits.Abstract.dll", "2.0.0")
                },
                    true
                    ),
            }));

            // targets
            var targets      = result.Should().HavePropertyAsObject("targets").Subject;
            var target       = targets.Should().HavePropertyAsObject("Target").Subject;
            var library      = target.Should().HavePropertyAsObject("PackageName/1.2.3").Subject;
            var dependencies = library.Should().HavePropertyAsObject("dependencies").Subject;

            dependencies.Should().HavePropertyValue("Fruits.Abstract.dll", "2.0.0");
            library.Should().HavePropertyAsObject("runtime")
            .Subject.Should().HaveProperty("Banana.dll");

            library.Should().HavePropertyAsObject("compile")
            .Subject.Should().HaveProperty("ref/Banana.dll");

            var runtimeTargets = library.Should().HavePropertyAsObject("runtimeTargets").Subject;

            var runtimeAssembly = runtimeTargets.Should().HavePropertyAsObject("Banana.Win7-x64.dll").Subject;

            runtimeAssembly.Should().HavePropertyValue("rid", "win7-x64");
            runtimeAssembly.Should().HavePropertyValue("assetType", "runtime");

            var nativeLibrary = runtimeTargets.Should().HavePropertyAsObject("Banana.Win7-x64.so").Subject;

            nativeLibrary.Should().HavePropertyValue("rid", "win7-x64");
            nativeLibrary.Should().HavePropertyValue("assetType", "native");

            //libraries
            var libraries = result.Should().HavePropertyAsObject("libraries").Subject;

            library = libraries.Should().HavePropertyAsObject("PackageName/1.2.3").Subject;
            library.Should().HavePropertyValue("sha512", "HASH");
            library.Should().HavePropertyValue("type", "package");
            library.Should().HavePropertyValue("serviceable", true);
        }
Example #4
0
        public void UsesFileNameAsAssemblyNameInCreate()
        {
            var assembly = RuntimeAssembly.Create("path/to/System.Collections.dll");

            assembly.Name.Name.Should().Be("System.Collections");
        }