Author: msierad
Date: 2007-01-16 08:18:45 -0500 (Tue, 16 Jan 2007)
New Revision: 71131
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemGroupCollectionTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemGroupTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildPropertyGroupCollectionTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildPropertyGroupTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ImportCollectionTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetCollectionTest.cs
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/UsingTaskCollectionTest.cs
Log:
2007-01-16 Marek Sieradzki <[EMAIL PROTECTED]>
* BuildItemTest.cs, BuildPropertyGroupTest.cs,
UsingTaskCollectionTest.cs, ImportCollectionTest.cs,
BuildItemGroupTest.cs, BuildPropertyGroupCollectionTest.cs,
TargetCollectionTest.cs, EngineTest.cs, ProjectTest.cs,
BuildItemGroupCollectionTest.cs: Added more tests and replaced
Ignores with Category ("NotDotNet")
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemGroupCollectionTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemGroupCollectionTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemGroupCollectionTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -40,7 +40,8 @@
Project project;
[Test]
- [Ignore ("NullRefException on MS NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (ArgumentNullException))]
public void TestCopyTo1 ()
{
string documentString = @"
@@ -80,7 +81,7 @@
}
[Test]
- [Ignore ("Throws InvalidCastException on MS NET 2.0")]
+ [ExpectedException (typeof (InvalidCastException))]
public void TestCopyTo3 ()
{
string documentString = @"
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemGroupTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemGroupTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemGroupTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -187,6 +187,40 @@
}
[Test]
+ public void TestAddNewItem6 ()
+ {
+ Engine engine;
+ Project project;
+ string name = "name";
+ string include = "include";
+ BuildItemGroup [] groups = new BuildItemGroup [1];
+
+ string documentString = @"
+ <Project
xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ <ItemGroup />
+ </Project>
+ ";
+
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ project.ItemGroups.CopyTo (groups, 0);
+ BuildItem bi = groups [0].AddNewItem (name, include,
true);
+
+ Assert.AreEqual (String.Empty, bi.Condition, "A1");
+ Assert.AreEqual (String.Empty, bi.Exclude, "A2");
+ Assert.AreEqual (include, bi.FinalItemSpec, "A3");
+ Assert.AreEqual (Utilities.Escape (include),
bi.Include, "A4");
+ Assert.IsFalse (bi.IsImported, "A5");
+ Assert.AreEqual (name, bi.Name, "A6");
+ //Assert.AreSame (bi, groups [0] [0], "A7");
+ Assert.IsTrue (object.ReferenceEquals (bi, groups
[0][0]), "A7");
+ //Assert.AreNotSame (bi, project.EvaluatedItems [0],
"A8");
+ Assert.IsFalse (object.ReferenceEquals (bi,
project.EvaluatedItems [0]), "A8");
+ }
+
+ [Test]
public void TestClear1 ()
{
BuildItemGroup big = new BuildItemGroup ();
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -80,7 +80,8 @@
}
[Test]
- [Ignore ("NullRefException on MS .NET 2.0")]
+ [ExpectedException (typeof (ArgumentNullException))]
+ [Category ("NotDotNet")]
public void TestCtor4 ()
{
new BuildItem (null, (ITaskItem) null);
@@ -101,7 +102,7 @@
}
[Test]
- [Ignore ("IndexOutOfRange on MS .NET 2.0")]
+ [Category ("NotDotNet")] //IndexOutOfRange throw by MS .NET 2.0
public void TestCtor7 ()
{
new BuildItem (String.Empty, "something");
@@ -205,9 +206,9 @@
Assert.AreEqual (metadataValue,
destination.GetEvaluatedMetadata (metadataName), "A2");
}
- // NOTE: it's weird that they don't throw ArgumentNullException
[Test]
- [Ignore ("MS throws NullRefException")]
+ [ExpectedException (typeof (ArgumentNullException))]
+ [Category ("NotDotNet")]
public void TestCopyCustomMetadataTo2 ()
{
BuildItem item = new BuildItem ("name", "include");
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildPropertyGroupCollectionTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildPropertyGroupCollectionTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildPropertyGroupCollectionTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -40,7 +40,8 @@
Project project;
[Test]
- [Ignore ("NullRefException on MS NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (ArgumentNullException))]
public void TestCopyTo1 ()
{
string documentString = @"
@@ -81,7 +82,7 @@
}
[Test]
- [Ignore ("Throws InvalidCastException on MS NET 2.0")]
+ [ExpectedException (typeof (InvalidCastException))]
public void TestCopyTo3 ()
{
string documentString = @"
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildPropertyGroupTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildPropertyGroupTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildPropertyGroupTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -60,8 +60,7 @@
}
[Test]
- [ExpectedException (typeof (InvalidOperationException),
- "This method is only valid for persisted
<System.Object[]> elements.")]
+ [ExpectedException (typeof (InvalidOperationException))]
public void TestAddNewProperty1 ()
{
string name = "name";
@@ -73,8 +72,7 @@
}
[Test]
- [ExpectedException (typeof (InvalidOperationException),
- "This method is only valid for persisted
<System.Object[]> elements.")]
+ [ExpectedException (typeof (InvalidOperationException))]
public void TestAddNewProperty2 ()
{
Engine engine;
@@ -333,7 +331,8 @@
}
[Test]
- [Ignore ("NullRefException on MS .NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (ArgumentNullException))]
public void TestRemoveProperty1 ()
{
BuildPropertyGroup bpg = new BuildPropertyGroup ();
@@ -456,7 +455,9 @@
}
[Test]
- [Ignore ("It doesn't throw an exception on MS .NET 2.0")]
+ [Category ("NotDotNet")]
+ [Category ("NotWorking")]
+ [ExpectedException (typeof (InvalidOperationException))]
public void TestRemoveProperty7 ()
{
Engine engine;
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
2007-01-16 13:18:45 UTC (rev 71131)
@@ -1,3 +1,12 @@
+2007-01-16 Marek Sieradzki <[EMAIL PROTECTED]>
+
+ * BuildItemTest.cs, BuildPropertyGroupTest.cs,
+ UsingTaskCollectionTest.cs, ImportCollectionTest.cs,
+ BuildItemGroupTest.cs, BuildPropertyGroupCollectionTest.cs,
+ TargetCollectionTest.cs, EngineTest.cs, ProjectTest.cs,
+ BuildItemGroupCollectionTest.cs: Added more tests and replaced
+ Ignores with Category ("NotDotNet")
+
2007-01-14 Marek Sieradzki <[EMAIL PROTECTED]>
* BuildItemGroupTest.cs, ProjectTest.cs: Added more tests.
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -162,7 +162,8 @@
}
[Test]
- [Ignore ("NRE on .NET 2.0")]
+ [ExpectedException (typeof (ArgumentNullException))]
+ [Category ("NotDotNet")]
public void TestRegisterLogger ()
{
engine = new Engine (Consts.BinPath);
@@ -183,7 +184,8 @@
}
[Test]
- [Ignore ("NRE on .NET 2.0")]
+ [ExpectedException (typeof (ArgumentNullException))]
+ [Category ("NotDotNet")]
public void TestUnloadProject2 ()
{
Engine a = new Engine (Consts.BinPath);
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ImportCollectionTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ImportCollectionTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ImportCollectionTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -75,7 +75,8 @@
}
[Test]
- [Ignore ("NullRefException on MS .NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (ArgumentNullException))]
public void TestCopyTo1 ()
{
string documentString = @"
@@ -111,7 +112,7 @@
}
[Test]
- [Ignore ("InvalidCastException on MS .NET 2.0")]
+ [ExpectedException (typeof (InvalidCastException))]
public void TestCopyTo3 ()
{
string documentString = @"
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -161,6 +161,42 @@
}
[Test]
+ [Ignore ("Too detailed probably (implementation specific)")]
+ public void TestAddNewItem1 ()
+ {
+ Engine engine;
+ Project project;
+ BuildItemGroup [] groups = new BuildItemGroup [1];
+
+ string documentString = @"
+ <Project
xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ </Project>
+ ";
+
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ BuildItem item = project.AddNewItem ("A", "B");
+
+ Assert.AreEqual (1, project.ItemGroups.Count, "A1");
+ project.ItemGroups.CopyTo (groups, 0);
+ Assert.AreEqual (1, groups [0].Count, "A2");
+ Assert.AreEqual ("B", groups [0] [0].Include, "A3");
+ Assert.AreEqual ("B", groups [0] [0].FinalItemSpec,
"A4");
+ Assert.AreEqual ("A", groups [0] [0].Name, "A5");
+ //Assert.AreNotSame (item, groups [0] [0], "A6");
+ Assert.IsFalse (object.ReferenceEquals (item, groups
[0] [0]), "A6");
+
+ Assert.AreEqual (1, project.EvaluatedItems.Count, "A7");
+ Assert.AreEqual ("B", project.EvaluatedItems
[0].Include, "A8");
+ Assert.AreEqual ("B", project.EvaluatedItems
[0].FinalItemSpec, "A9");
+ Assert.AreEqual ("A", project.EvaluatedItems [0].Name,
"A10");
+ //Assert.AreNotSame (item, project.EvaluatedItems [0],
"A11");
+ Assert.IsFalse (object.ReferenceEquals (item,
project.EvaluatedItems [0]), "A11");
+ }
+
+ [Test]
public void TestAddNewItemGroup ()
{
Engine engine;
@@ -665,7 +701,8 @@
}
[Test]
- [Ignore ("NullRefException under MS .NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (ArgumentNullException))]
public void TestGlobalProperties3 ()
{
Engine engine;
@@ -684,7 +721,7 @@
}
[Test]
- [Ignore ("NullRefException under MS .NET 2.0")]
+ [Ignore ("needs rewriting")]
public void TestGlobalProperties4 ()
{
Engine engine;
@@ -710,7 +747,8 @@
}
[Test]
- [Ignore ("It should throw an exception under MS NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (InvalidOperationException))]
public void TestGlobalProperties5 ()
{
Engine engine;
@@ -776,7 +814,8 @@
}
[Test]
- [Ignore ("NullRefException on MS .NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (ArgumentNullException))]
public void TestRemoveItemGroup1 ()
{
Engine engine;
@@ -810,7 +849,8 @@
}
[Test]
- [Ignore ("NullRefException on MS .NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (ArgumentNullException))]
public void TestRemoveItem1 ()
{
Engine engine;
@@ -839,7 +879,6 @@
[Test]
[ExpectedException (typeof (InvalidOperationException),
"The \"BuildItemGroup\" object
specified does not belong to the correct \"Project\" object.")]
- [Category ("NotWorking")]
public void TestRemoveItem3 ()
{
Engine engine;
@@ -856,7 +895,8 @@
}
[Test]
- [Ignore ("Should throw an exception")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (InvalidOperationException))]
public void TestRemoveItem4 ()
{
Engine engine;
@@ -946,7 +986,8 @@
Assert.IsNull (project.SchemaFile, "A1");
}
[Test]
- [Ignore ("NRE on .NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (ArgumentNullException))]
public void TestSetProjectExtensions1 ()
{
Engine engine;
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetCollectionTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetCollectionTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetCollectionTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -162,7 +162,7 @@
}
[Test]
- [Ignore ("InvalidCastException on MS .NET 2.0")]
+ [ExpectedException (typeof (InvalidCastException))]
public void TestCopyTo3 ()
{
string documentString = @"
@@ -303,7 +303,8 @@
}
[Test]
- [Ignore ("NullRefException on MS .NET 2.0")]
+ [ExpectedException (typeof (ArgumentNullException))]
+ [Category ("NotDotNet")]
public void TestRemoveTarget2 ()
{
string documentString = @"
Modified:
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/UsingTaskCollectionTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/UsingTaskCollectionTest.cs
2007-01-16 13:11:49 UTC (rev 71130)
+++
trunk/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/UsingTaskCollectionTest.cs
2007-01-16 13:18:45 UTC (rev 71131)
@@ -138,7 +138,8 @@
}
[Test]
- [Ignore ("Throws InvalidCastException on MS NET 2.0")]
+ [Category ("NotDotNet")]
+ [ExpectedException (typeof (InvalidCastException))]
public void TestCopyTo3 ()
{
string documentString = @"
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches