public void TestMoveValue()
        {
            extractor.PropertySheetPath = "TestData\\test.props";
            ReferencedProperty refProp = extractor.AllFoundProperties["AssemblyName"];
            var vals             = refProp.PropertyValues;
            ReferencedValues val = vals["a"];
            int before           = refProp.UsedCount;

            extractor.MoveValue(val);
            int after = refProp.UsedCount;

            Assert.AreEqual(before - 1, after);
            Assert.AreEqual(2, refProp.Projects.Count());
            var projs = (from p in refProp.Projects
                         let name = Path.GetFileName(p.FullPath)
                                    orderby name ascending
                                    select name).ToList();

            Assert.AreEqual("B.csproj", projs[0]);
            Assert.AreEqual("C.csproj", projs[1]);
            Assert.AreEqual(2, refProp.PropertyValues.Count());
        }
Пример #2
0
 /// <summary>
 /// Removes a property that matches a given value from all the projects for the current configuration and current platform.
 /// The property is then added to the property sheet with the given value.
 /// </summary>
 /// <param name="val">The given ReferenceValues instance to move</param>
 public void MoveProperty(ReferencedValues val)
 {
     model.MoveValue(val);
     OnPropertyChanged("FoundProperties");
     OnPropertyChanged("PropSheetProperties");
 }