예제 #1
0
        void BuildLibraryCore(string[] expectedResources)
        {
            var library = Path.Combine(LibraryProjectBinPath, "MyLibrary.dll");

            RunTargetOnInstance(LibraryProjectInstance, TargetName.Build);

            Assert.IsTrue(string.IsNullOrEmpty(LibraryProjectInstance.GetPropertyValue("AppBundleDir")), "#1");
            var entries = Directory.GetFileSystemEntries(LibraryProjectBinPath);

            Assert.AreEqual(2, entries.Length, "#1");
            Assert.IsTrue(File.Exists(library), "#2");
            Assert.IsTrue(File.Exists(Path.ChangeExtension(library, ".pdb")), "#3");

            var assemblyDef     = AssemblyDefinition.ReadAssembly(library);
            var actualResources = assemblyDef.MainModule.Resources.Select(n => n.Name).ToList();

            foreach (var resource in expectedResources)
            {
                Assert.IsTrue(actualResources.Contains(resource), "#1. " + resource);
            }
            Assert.AreEqual(expectedResources.Length, assemblyDef.MainModule.Resources.OfType <EmbeddedResource> ().Count(), "#2");
        }
예제 #2
0
 public void DetectAppManifest_LibraryProject()
 {
     RunTargetOnInstance(LibraryProjectInstance, TargetName.DetectAppManifest);
     Assert.That(LibraryProjectInstance.GetPropertyValue("_AppManifest"), Is.Not.Null.Or.Empty, "#1");
 }
예제 #3
0
 public void DetectAppManifest_LibraryProject()
 {
     RunTargetOnInstance(LibraryProjectInstance, TargetName.DetectAppManifest);
     Assert.IsNullOrEmpty(LibraryProjectInstance.GetPropertyValue("_AppManifest"), "#1");
 }