public void OneFromUnspecifiedIsEmpty() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); t.Exclude = new ITaskItem[] { new TaskItem("MyFile.txt") }; bool success = t.Execute(); Assert.True(success); Assert.Equal(0, t.Include.Length); }
public void OneFromOneIsZero() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); t.Include = new ITaskItem[] { new TaskItem("MyFile.txt") }; t.Exclude = new ITaskItem[] { new TaskItem("MyFile.txt") }; bool success = t.Execute(); Assert.IsTrue(success); Assert.AreEqual(0, t.Include.Length); }
public void UnspecifiedFromOneIsOne() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); t.Include = new ITaskItem[] { new TaskItem("MyFile.txt") }; bool success = t.Execute(); Assert.True(success); Assert.Equal(1, t.Include.Length); Assert.Equal(t.Include[0].ItemSpec, t.Include[0].ItemSpec); }
public void OneFromOneMismatchIsOne() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); t.Include = new ITaskItem[] { new TaskItem("MyFile.txt") }; t.Exclude = new ITaskItem[] { new TaskItem("MyFileOther.txt") }; bool success = t.Execute(); Assert.True(success); Assert.Equal(1, t.Include.Length); Assert.Equal("MyFile.txt", t.Include[0].ItemSpec); }
public void UnspecifiedFromUnspecifiedIsEmpty() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); bool success = t.Execute(); Assert.True(success); Assert.Equal(0, t.Include.Length); }
public void AdditionalMetaDataOverwriteExisting() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); TaskItem item = new TaskItem("MyFile.txt"); item.SetMetadata("MyMetaData", "SomePreserveMeValue"); t.Include = new ITaskItem[] { item }; // The default for CreateItem is to overwrite any existing metadata // t.PreserveExistingMetadata = false; t.AdditionalMetadata = new string[] { "MyMetaData=SomeOverwriteValue" }; bool success = t.Execute(); Assert.True(success); Assert.Equal("SomeOverwriteValue", t.Include[0].GetMetadata("MyMetaData")); }
public void AdditionalMetaData() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); t.Include = new ITaskItem[] { new TaskItem("MyFile.txt") }; t.AdditionalMetadata = new string[] { "MyMetaData=SomeValue" }; bool success = t.Execute(); Assert.True(success); Assert.Equal("SomeValue", t.Include[0].GetMetadata("MyMetaData")); }
public void CaseDoesntMatter() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); t.Include = new ITaskItem[] { new TaskItem("MyFile.txt") }; t.Exclude = new ITaskItem[] { new TaskItem("myfile.tXt") }; bool success = t.Execute(); Assert.True(success); Assert.Equal(0, t.Include.Length); }
public void AdditionalMetaDataPreserveExisting() { CreateItem t = new CreateItem(); t.BuildEngine = new MockEngine(); TaskItem item = new TaskItem("MyFile.txt"); item.SetMetadata("MyMetaData", "SomePreserveMeValue"); t.Include = new ITaskItem[] { item }; t.PreserveExistingMetadata = true; t.AdditionalMetadata = new string[] { "MyMetaData=SomeValue" }; bool success = t.Execute(); Assert.IsTrue(success); Assert.AreEqual("SomePreserveMeValue", t.Include[0].GetMetadata("MyMetaData")); }