Exemplo n.º 1
0
        public void Should_find_no_difference_between_original_Scrum_project_and_Agile_project_converted_to_Scrum()
        {
            PrepareTestEnvironment.ResetCollectionOnce();

            TfsConnection.ClientSettingsDirectory = Path.Combine(TestContext.TestRunResultsDirectory, "TfsClient");

            var factory = new ProcessTemplateFactory();

            var unconverted = factory.FromActiveTeamProject(TestCollectionUri, "Agile-6.1");
            var goal = factory.FromActiveTeamProject(TestCollectionUri, "Scrum-2.1");

            var agileToScrumDiffEngine = new DiffEngine(ProcessTemplateMaps.Agile61ToScrum21());

            var initialDifferences = agileToScrumDiffEngine.CompareProcessTemplates(unconverted, goal);

            var morphEngine = new MorphEngine();
            var actions = morphEngine.GenerateActions(initialDifferences);

            morphEngine.Apply(TestCollectionUri, "Agile-6.1", actions, TestContext.TestRunResultsDirectory);

            var emptyMapDiffEngine = new DiffEngine(ProcessTemplateMap.Empty());

            var converted = factory.FromActiveTeamProject(TestCollectionUri, "Agile-6.1");

            var finalDifferences = emptyMapDiffEngine.CompareProcessTemplates(converted, goal);

            var reportBuilder = new ReportBuilder();
            var report = reportBuilder.WriteDifferencesToXml(finalDifferences);
            report.Save(Path.Combine(TestContext.TestRunResultsDirectory, TestContext.TestName + ".xml"));

            Assert.AreEqual(0, finalDifferences.Count(), "Should be zero differences between new Scrum 2.1 project and the converted Agile 6.1 project.");
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            if (args.Length != 3)
            {
                System.Console.WriteLine("usage: {0} <collection uri> <project name to morph> <project name to use as template>",
                    Process.GetCurrentProcess().ProcessName);
                return;
            }

            var collectionUri = new Uri(args[0]);
            var projectName = args[1];
            var templateProjectName = args[2];

            var factory = new ProcessTemplateFactory();

            var currentTemplate = factory.FromActiveTeamProject(collectionUri, projectName);
            var goalTemplate = factory.FromActiveTeamProject(collectionUri, templateProjectName);

            // TODO test for project property showing process template used and update after conversion

            var diffEngine = new DiffEngine(ProcessTemplateMap.ConvertScrum2ToAgile6());
            var differences = diffEngine.CompareProcessTemplates(currentTemplate, goalTemplate);

            var engine = new MorphEngine();

            var actions = engine.GenerateActions(differences);
            foreach (var action in actions)
            {
                System.Console.WriteLine(action.ToString());
            }

            //var filteredActions = actions.Where(a => !(a is DestroyWitdMorphAction)); // TODO optionally skip deleting extra work item items

            engine.Apply(collectionUri, projectName, actions, Path.GetTempPath()); //TODO replace temp path with something useful
        }
Exemplo n.º 3
0
        public void Should_find_no_differences_between_Scrum_project_and_template()
        {
            Assert.Inconclusive("Templates naturally have differences from the projects they create");

            var factory = new ProcessTemplateFactory();

            var collectionTemplate = factory.FromCollectionTemplates(TestCollectionUri, "Microsoft Visual Studio Scrum 2.1");
            var activeProject = factory.FromActiveTeamProject(TestCollectionUri, "Scrum-2.1");

            var diffEngine = new DiffEngine(ProcessTemplateMap.Empty());

            var differences = diffEngine.CompareProcessTemplates(activeProject, collectionTemplate);

            Assert.AreEqual(0, differences.Count(), "Should be zero differences between new Scrum 2.1 project and the template it was created from.");
        }