public void ResourceAssembliesProperlyDetermined() { var packageAssemblyName = "solution.resources"; var libs = new System.Collections.Generic.List <string>() { "lib/" + packageAssemblyName + ".dll", "lib/net40/" + packageAssemblyName + ".dll", "lib/net40/" + packageAssemblyName + "a.dll", "lib/net40/" + packageAssemblyName + "b.dll", "lib/net45/" + packageAssemblyName + ".dll", "lib/" + packageAssemblyName + "_extra.dll", "lib/" + packageAssemblyName + ".js", }; var assembliesCount = libs.Count() - 1; // one is ignored because of the ext. foreach (var culture in CultureInfo.GetCultures(CultureTypes.AllCultures).Where(p => !string.IsNullOrEmpty(p.Name)).Select(c => c.Name)) { // Add all non-standart cultures. libs.Add("lib/net45/" + culture + "/" + packageAssemblyName + ".resources.dll"); } var asemblyReferencesCount = libs.Where(p => PackageReaderBase.IsAssemblyReference(p)).Count(); Assert.Equal(asemblyReferencesCount, assembliesCount); }
private static bool IsAssemblyReference(string filePath) { // assembly reference must be under lib/ if (!filePath.StartsWith(PackagingConstants.Folders.Lib + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) && !filePath.StartsWith(PackagingConstants.Folders.Lib + Path.AltDirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) { return(false); } var fileName = Path.GetFileName(filePath); // if it's an empty folder, yes if (fileName == PackagingCoreConstants.EmptyFolder) { return(true); } // Assembly reference must have a .dll|.exe|.winmd extension and is not a resource assembly: return(PackageReaderBase.IsAssemblyReference(filePath)); }