public void Can_Apply(string scenario, string globalJson)
        {
            using (ApprovalResults.ForScenario(scenario))
            {
                // arrange

                var upgradeActions         = new List <ISolutionUpgradeAction>();
                var testFileUpgradeContext = new TestSolutionUpgradeContext(globalJson);

                // updates the sdk version in global json.
                var runtimeUpgradeAction = new UpdateSdkVersion("1.0.0-preview1-002702");
                upgradeActions.Add(runtimeUpgradeAction);

                // Apply these actions to the global.json file.
                foreach (var upgradeAction in upgradeActions)
                {
                    upgradeAction.Apply(testFileUpgradeContext);
                }

                // save the changes.
                testFileUpgradeContext.SaveChanges();

                // assert.
                var modifiedContents = testFileUpgradeContext.ModifiedJsonContents;
                Approvals.VerifyJson(modifiedContents);
            }
        }
        private IEnumerable <ISolutionUpgradeAction> GetSchemaUpgrades(SolutionMigrationOptions options, SolutionUpgradeContext context)
        {
            var upgradeActions = new List <ISolutionUpgradeAction>();

            // upgrades the compilation options section.
            var updateSdkVersion = new UpdateSdkVersion(options.SdkVersionNumber);

            upgradeActions.Add(updateSdkVersion);

            return(upgradeActions);
        }