public void ProjectOutputElementModify() { var pair = GetNewInMemoryProject("temp.prj"); var xmlPair = new ProjectXmlPair(pair); var newTarget = xmlPair.AddNewChaildWithVerify<ProjectTargetElement>(ObjectType.View, "TargetToTestTask", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n)); var newTask = newTarget.AddNewNamedChaildWithVerify<ProjectTaskElement>(ObjectType.Real, "NewTaskName", (t, n) => t.AddTask(n)); const string NewOutputItem = "NewOutputItem"; const string ItemType = "CPPSource"; var newOutputItem = newTask.AddNewChaildWithVerify<ProjectOutputElement>(ObjectType.View, NewOutputItem, (t, n) => t.AddOutputItem(n, ItemType), (oi, n) => oi.TaskParameter == n); Assert.True(newOutputItem.View.IsOutputItem); Assert.False(newOutputItem.View.IsOutputProperty); const string NewOutputProperty = "NewOutputProperty"; const string PropertyName = "OutputPropName"; var newOutputProp = newTask.AddNewChaildWithVerify<ProjectOutputElement>(ObjectType.View, NewOutputProperty, (t, n) => t.AddOutputProperty(n, PropertyName), (oi, n) => oi.TaskParameter == n); Assert.False(newOutputProp.View.IsOutputItem); Assert.True(newOutputProp.View.IsOutputProperty); newOutputItem.VerifySetter(NewOutputItem.Ver(1), (o) => o.TaskParameter, (o, v) => o.TaskParameter = v); newOutputProp.VerifySetter(NewOutputProperty.Ver(1), (o) => o.TaskParameter, (o, v) => o.TaskParameter = v); newOutputItem.VerifySetter(ItemType.Ver(1), (o) => o.ItemType, (o, v) => o.ItemType = v); Assert.ThrowsAny<InvalidOperationException>(() => newOutputProp.View.ItemType = "foo"); newOutputProp.VerifySetter(PropertyName.Ver(1), (o) => o.PropertyName, (o, v) => o.PropertyName = v); Assert.ThrowsAny<InvalidOperationException>(() => newOutputItem.View.PropertyName = "foo"); }