Пример #1
0
        public void AllRuntimeIdsAreGeneratedCorrectly(string osName, string version, string architecture, string expectedRids)
        {
            var runtimeEnv = new DummyRuntimeEnvironment()
            {
                OperatingSystem        = osName,
                OperatingSystemVersion = version,
                RuntimeArchitecture    = architecture
            };

            Assert.Equal(expectedRids.Split(','), RuntimeEnvironmentExtensions.GetAllRuntimeIdentifiersWithoutOverride(runtimeEnv).ToArray());
        }
Пример #2
0
        public void RuntimeIdIsGeneratedCorrectly(string osName, string version, string architecture, string expectedRid)
        {
            var runtimeEnv = new DummyRuntimeEnvironment()
            {
                OperatingSystem        = osName,
                OperatingSystemVersion = version,
                RuntimeArchitecture    = architecture
            };

            Assert.Equal(expectedRid, RuntimeEnvironmentExtensions.GetRuntimeIdentifierWithoutOverride(runtimeEnv));
        }
Пример #3
0
        static GenFuTagHelper()
        {
            //TODO: Review with James. This stuff used to be wired up via DI but is not anymore.
            //      It was also very slow so I had to put it in a static constructor. Doing this for every tag helper instance was too slow.
            var              runtime        = RuntimeEnvironmentExtensions.GetRuntimeIdentifier(PlatformServices.Default.Runtime);
            var              projectContext = ProjectContext.CreateContextForEachFramework(Directory.GetCurrentDirectory(), null, new[] { runtime }).First();
            ApplicationInfo  appInfo        = new ApplicationInfo("TagHelperSamples.GenFu", PlatformServices.Default.Application.ApplicationBasePath);
            ILibraryExporter exporter       = new LibraryExporter(projectContext, appInfo);

            _references = new List <MetadataReference>();
            var exports      = exporter.GetAllExports();
            var metaDataRefs = exports.SelectMany(x => x.GetMetadataReferences()).ToList();

            foreach (var reference in metaDataRefs)
            {
                _references.Add(reference);
            }
        }