Пример #1
0
        protected override void RunTest(Action <RuntimeConfig> runtimeConfigCustomizer, string testAssemblyName, string appAsmVersion, string appFileVersion, string frameworkWins)
        {
            var app = SharedState.CreateTestFrameworkReferenceApp(b => b
                                                                  .WithPackage(TestVersionsPackage, "1.0.0", lib => lib
                                                                               .WithAssemblyGroup(null, g => g
                                                                                                  .WithAsset(testAssemblyName + ".dll", rf => rf
                                                                                                             .WithVersion(appAsmVersion, appFileVersion)))));

            if (runtimeConfigCustomizer is not null)
            {
                var runtimeConfig = new RuntimeConfig(app.RuntimeConfigJson);
                runtimeConfigCustomizer(runtimeConfig);
                runtimeConfig.Save();
            }

            string expectedBaseLocation = frameworkWins switch
            {
                MicrosoftNETCoreApp => SharedState.DotNetWithNetCoreApp.GreatestVersionSharedFxPath,
                HighWare => Path.Combine(SharedState.DotNetWithNetCoreApp.BinPath, "shared", HighWare, "1.1.1"),
                _ => app.Location,
            };
            string expectedTestAssemblyPath = Path.Combine(expectedBaseLocation, testAssemblyName + ".dll");

            SharedState.DotNetWithNetCoreApp.Exec(app.AppDll)
            .EnableTracingAndCaptureOutputs()
            .Execute()
            .Should().Pass()
            .And.HaveResolvedAssembly(expectedTestAssemblyPath);
        }
Пример #2
0
        protected override void RunTest(string testAssemblyName, string appAsmVersion, string appFileVersion, bool appWins)
        {
            var app = SharedState.CreateTestFrameworkReferenceApp(b => b
                                                                  .WithPackage(TestVersionsPackage, "1.0.0", lib => lib
                                                                               .WithAssemblyGroup(null, g => g
                                                                                                  .WithAsset(testAssemblyName + ".dll", rf => rf
                                                                                                             .WithVersion(appAsmVersion, appFileVersion)))));

            string expectedTestAssemblyPath =
                Path.Combine(appWins ? app.Location : SharedState.DotNetWithNetCoreApp.GreatestVersionSharedFxPath, testAssemblyName + ".dll");

            SharedState.DotNetWithNetCoreApp.Exec(app.AppDll)
            .EnableTracingAndCaptureOutputs()
            .Execute()
            .Should().Pass()
            .And.HaveResolvedAssembly(expectedTestAssemblyPath);
        }