public void ApplyProjectBuild_WithExistingDesignTimeChanges_CanRemoveItem(string currentFiles, string filesToRemove, string expected)
        {
            string[] expectedFiles = expected.Length == 0 ? Array.Empty <string>() : expected.Split(';');

            var handler = CreateInstanceWithDesignTimeItems(@"C:\Project\Project.csproj", currentFiles);

            var difference = IProjectChangeDiffFactory.WithRemovedItems(filesToRemove);

            ApplyProjectBuild(handler, 2, difference);

            Assert.Equal(expectedFiles.OrderBy(f => f), handler.FileNames.OrderBy(f => f));
        }
        public void ApplyProjectBuild_WhenOlderEvaluationChangesWithRemovedConflict_DesignTimeWinsOut()
        {
            var handler = CreateInstance(@"C:\Project\Project.csproj");

            int evaluationVersion = 0;

            // Setup the "current state"
            ApplyProjectEvaluation(handler, evaluationVersion, IProjectChangeDiffFactory.WithRemovedItems("Source.cs"));

            int designTimeVersion = 1;

            ApplyProjectBuild(handler, designTimeVersion, IProjectChangeDiffFactory.WithAddedItems("Source.cs"));

            Assert.Single(handler.FileNames, @"C:\Project\Source.cs");
        }
Exemple #3
0
        public void ApplyDesignTimeChanges_WhenNewerEvaluationChangesWithRemovedConflict_EvaluationWinsOut()
        {
            var handler = CreateInstance(@"C:\Project\Project.cs");

            int evaluationVersion = 1;

            // Setup the "current state"
            ApplyEvaluationChanges(handler, evaluationVersion, IProjectChangeDiffFactory.WithRemovedItems("Source.cs"));

            int designTimeVersion = 0;

            ApplyDesignTimeChanges(handler, designTimeVersion, IProjectChangeDiffFactory.WithAddedItems("Source.cs"));

            Assert.Empty(handler.Files);
        }