コード例 #1
0
        public void Can_Apply(string scenario, string json)
        {
            using (ApprovalResults.ForScenario(scenario))
            {
                // arrange
                var testFileUpgradeContext = new TestJsonBaseProjectUpgradeContext(json, null, null);
                // get target nuget packages for RC2, Preview1 tooling.
                var targetNuGetPackages =
                    ProjectMigrator.GetRc2DependencyPackageMigrationList(ToolingVersion.Preview1,
                                                                         testFileUpgradeContext);

                //  PackageMigrationHelper.GetRc2DependencyPackageMigrationList(ToolingVersion.Preview1, testFileUpgradeContext);

                var sut = new MigrateDependencyPackages(targetNuGetPackages);

                // act
                sut.Apply(testFileUpgradeContext);
                testFileUpgradeContext.SaveChanges();

                // assert.
                var modifiedContents = testFileUpgradeContext.ModifiedProjectJsonContents;
                Approvals.VerifyJson(modifiedContents);
            }
        }