Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
//
// AnyEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class BuildErrorEventArgsTest {
[Test]
public void AssignmentTest ()
{
BuildErrorEventArgs beea;
string subcategory = "subcategory";
string code = "CS0000";
string file = "file";
int lineNumber = 1;
int columnNumber = 2;
int endLineNumber = 3;
int endColumnNumber = 4;
string message = "message";
string helpKeyword = "helpKeyword";
string senderName = "MSBuild";
beea = new BuildErrorEventArgs (subcategory, code, file, lineNumber, columnNumber, endLineNumber,
endColumnNumber, message, helpKeyword, senderName);
Assert.AreEqual (subcategory, beea.Subcategory, "Subcategory");
Assert.AreEqual (code, beea.Code, "Code");
Assert.AreEqual (file, beea.File, "File");
Assert.AreEqual (lineNumber, beea.LineNumber, "LineNumber");
Assert.AreEqual (columnNumber, beea.ColumnNumber, "ColumnNumber");
Assert.AreEqual (endLineNumber, beea.EndLineNumber, "EndLineNumber");
Assert.AreEqual (endColumnNumber, beea.EndColumnNumber, "EndColumnNumber");
Assert.AreEqual (message, beea.Message, "Message");
Assert.AreEqual (helpKeyword, beea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (senderName, beea.SenderName, "SenderName");
}
}
}

View File

@@ -0,0 +1,67 @@
//
// BuildEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2006 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Threading;
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
class TestClass : BuildEventArgs {
public TestClass (string message, string helpKeyword, string senderName)
: base (message, helpKeyword, senderName)
{
}
}
[TestFixture]
public class BuildEventArgsTest {
[Test]
public void AssignmentTest ()
{
DateTime before, after;
string message = "message";
string helpKeyword = "helpKeyword";
string senderName = "senderName";
before = DateTime.Now;
TestClass tc = new TestClass (message, helpKeyword, senderName);
after = DateTime.Now;
Assert.AreEqual (message, tc.Message, "A1");
Assert.AreEqual (helpKeyword, tc.HelpKeyword, "A2");
Assert.AreEqual (senderName, tc.SenderName, "A3");
Assert.AreEqual (Thread.CurrentThread.GetHashCode (), tc.ThreadId, "A4");
Assert.IsTrue (before <= tc.Timestamp, "A5");
Assert.IsTrue (after >= tc.Timestamp, "A6");
}
}
}

View File

@@ -0,0 +1,29 @@
using System;
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework
{
[TestFixture]
public class BuildEventContextTest
{
[Test]
public void Compare ()
{
Assert.IsTrue (BuildEventContext.Invalid == BuildEventContext.Invalid, "#1");
Assert.IsFalse (BuildEventContext.Invalid != BuildEventContext.Invalid, "#2");
var inst = new BuildEventContext (0, 0, 0, 0);
Assert.IsFalse (BuildEventContext.Invalid == inst, "#3");
Assert.IsTrue (BuildEventContext.Invalid != inst, "#4");
Assert.IsFalse (BuildEventContext.Invalid == null, "#5");
Assert.IsTrue (BuildEventContext.Invalid != null, "#6");
Assert.IsFalse (BuildEventContext.Invalid.Equals (null), "#7");
Assert.IsFalse (BuildEventContext.Invalid.Equals (inst), "#8");
Assert.IsTrue (BuildEventContext.Invalid.Equals (BuildEventContext.Invalid), "#9");
Assert.IsFalse (inst.Equals (null), "#10");
Assert.IsTrue (inst.Equals (inst), "#11");
Assert.IsFalse (inst.Equals (BuildEventContext.Invalid), "#12");
}
}
}

View File

@@ -0,0 +1,49 @@
//
// BuildFinishedEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class BuildFinishedEventArgsTest {
[Test]
public void AssignmentTest ()
{
BuildFinishedEventArgs bfea;
string message = "message";
string helpKeyword = "helpKeyword";
bool succeeded = true;
bfea = new BuildFinishedEventArgs (message, helpKeyword, succeeded);
Assert.AreEqual (message, bfea.Message, "Message");
Assert.AreEqual (helpKeyword, bfea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (succeeded, bfea.Succeeded, "Succeeded");
}
}
}

View File

@@ -0,0 +1,51 @@
//
// BuildMessageEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class BuildMessageEventArgsTest {
[Test]
public void AssignmentTest ()
{
BuildMessageEventArgs bmea;
string message = "message";
string helpKeyword = "helpKeyword";
string senderName = "senderName";
MessageImportance messageImportance = MessageImportance.High;
bmea = new BuildMessageEventArgs (message, helpKeyword, senderName, messageImportance);
Assert.AreEqual (message, bmea.Message, "Message");
Assert.AreEqual (helpKeyword, bmea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (senderName, bmea.SenderName, "SenderName");
Assert.AreEqual (messageImportance, bmea.Importance, "Importance");
}
}
}

View File

@@ -0,0 +1,47 @@
//
// BuildStartedEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class BuildStartedEventArgsTest {
[Test]
public void AssignmentTest ()
{
BuildStartedEventArgs bsea;
string message = "message";
string helpKeyword = "helpKeyword";
bsea = new BuildStartedEventArgs (message, helpKeyword);
Assert.AreEqual (message, bsea.Message, "Message");
Assert.AreEqual (helpKeyword, bsea.HelpKeyword, "HelpKeyword");
}
}
}

View File

@@ -0,0 +1,64 @@
//
// BuildWarningEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class BuildWarningEventArgsTest {
[Test]
public void AssignmentTest ()
{
BuildWarningEventArgs bwea;
string subcategory = "subcategory";
string code = "CS0000";
string file = "file";
int lineNumber = 1;
int columnNumber = 2;
int endLineNumber = 3;
int endColumnNumber = 4;
string message = "message";
string helpKeyword = "helpKeyword";
string senderName = "senderName";
bwea = new BuildWarningEventArgs (subcategory, code, file, lineNumber, columnNumber, endLineNumber,
endColumnNumber, message, helpKeyword, senderName);
Assert.AreEqual (subcategory, bwea.Subcategory, "Subcategory");
Assert.AreEqual (code, bwea.Code, "Code");
Assert.AreEqual (file, bwea.File, "File");
Assert.AreEqual (lineNumber, bwea.LineNumber, "LineNumber");
Assert.AreEqual (columnNumber, bwea.ColumnNumber, "ColumnNumber");
Assert.AreEqual (endLineNumber, bwea.EndLineNumber, "EndLineNumber");
Assert.AreEqual (endColumnNumber, bwea.EndColumnNumber, "EndColumnNumber");
Assert.AreEqual (message, bwea.Message, "Message");
Assert.AreEqual (helpKeyword, bwea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (senderName, bwea.SenderName, "SenderName");
}
}
}

View File

@@ -0,0 +1,34 @@
2006-12-19 Marek Sieradzki <marek.sieradzki@gmail.com>
* ProjectStartedEventArgsTest.cs: Added check for Properties and
Items.
* TaskCommandLineEventArgsTest.cs: Added.
* LoggerExceptionTest.cs: Check for serialization names.
2006-09-02 Marek Sieradzki <marek.sieradzki@gmail.com>
* BuildEventArgsTest.cs: Small fix for TimeStamp check.
2006-06-22 Marek Sieradzki <marek.sieradzki@gmail.com>
* BuildErrorEventArgsTest.cs: Fixed header.
* BuildEventArgsTest.cs: Added.
2006-02-26 Marek Sieradzki <marek.sieradzki@gmail.com>
* ProjectStartedEventArgsTest.cs: Updated.
* CustomBuildEventArgsTest.cs: Removed.
* ExternalProjectStartedEventArgs.cs,
ExternalProjectFinishedEventArgs.cs: Added.
2005-08-30 Marek Sieradzki <marek.sieradzki@gmail.com>
* TaskFinishedEventArgsTest.cs, TargetStartedEventArgsTest.cs,
ProjectStartedEventArgsTest.cs, LoggerExceptionTest.cs,
TargetFinishedEventArgsTest.cs, ProjectFinishedEventArgsTest.cs,
BuildMessageEventArgsTest.cs, BuildWarningEventArgsTest.cs,
BuildStartedEventArgsTest.cs, TaskStartedEventArgsTest.cs,
BuildErrorEventArgsTest.cs, BuildFinishedEvenetArgsTest.cs,
CustomBuildEventArgsTest.cs: Added.

View File

@@ -0,0 +1,53 @@
//
// ExternalProjectFinishedEventArgsTest.cs
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class ExternalProjectFinishedEventArgsTest {
[Test]
public void AssignmentTest ()
{
ExternalProjectFinishedEventArgs epfea;
string message = "message";
string helpKeyword = "helpKeyword";
string senderName = "senderName";
string projectFile = "projectFile";
bool succeeded = true;
epfea = new ExternalProjectFinishedEventArgs (message, helpKeyword, senderName, projectFile, succeeded);
Assert.AreEqual (message, epfea.Message, "Message");
Assert.AreEqual (helpKeyword, epfea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (senderName, epfea.SenderName, "SenderName");
Assert.AreEqual (projectFile, epfea.ProjectFile, "ProjectFile");
Assert.AreEqual (succeeded, epfea.Succeeded, "Succeeded");
}
}
}

View File

@@ -0,0 +1,53 @@
//
// ExternalProjectStartedEventArgsTest.cs
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class ExternalProjectStartedEventArgsTest {
[Test]
public void AssignmentTest ()
{
ExternalProjectStartedEventArgs epsea;
string message = "message";
string helpKeyword = "helpKeyword";
string senderName = "senderName";
string projectFile = "projectFile";
string targetNames = "a;b;c";
epsea = new ExternalProjectStartedEventArgs (message, helpKeyword, senderName, projectFile, targetNames);
Assert.AreEqual (message, epsea.Message, "Message");
Assert.AreEqual (helpKeyword, epsea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (senderName, epsea.SenderName, "SenderName");
Assert.AreEqual (projectFile, epsea.ProjectFile, "ProjectFile");
Assert.AreEqual (targetNames, epsea.TargetNames, "TargetNames");
}
}
}

View File

@@ -0,0 +1,109 @@
//
// LoggerExceptionTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System;
using System.Runtime.Serialization;
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class LoggerExceptionTest {
[Test]
public void CtorMessageTest ()
{
LoggerException le;
string message = "message";
le = new LoggerException (message);
Assert.AreEqual (message, le.Message, "Message");
Assert.AreEqual (null, le.ErrorCode, "ErrorCode");
Assert.AreEqual (null, le.HelpKeyword, "HelpKeyword");
}
[Test]
public void CtorMessageExceptionTest ()
{
LoggerException le;
string message = "message";
Exception e = new Exception ("Inner exception message");
le = new LoggerException (message, e);
Assert.AreEqual (message, le.Message, "Message");
Assert.AreEqual (e, le.InnerException, "InnerException");
Assert.AreEqual (null, le.ErrorCode, "ErrorCode");
Assert.AreEqual (null, le.HelpKeyword, "HelpKeyword");
}
[Test]
public void CtorMessageExceptionCodeTest ()
{
LoggerException le;
string message = "message";
string errorCode = "CS0000";
string helpKeyword = "helpKeyword";
Exception e = new Exception ("Inner exception message");
le = new LoggerException (message, e, errorCode, helpKeyword);
Assert.AreEqual (message, le.Message, "Message");
Assert.AreEqual (e, le.InnerException, "InnerException");
Assert.AreEqual (errorCode, le.ErrorCode, "ErrorCode");
Assert.AreEqual (helpKeyword, le.HelpKeyword, "HelpKeyword");
}
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void TestGetObjectData1 ()
{
LoggerException le = new LoggerException ();
le.GetObjectData (null, new StreamingContext ());
}
[Test]
public void TestGetObjectData2 ()
{
StreamingContext sc = new StreamingContext ();
SerializationInfo si = new SerializationInfo (typeof (LoggerException), new FormatterConverter ());
LoggerException le;
string message = "message";
string errorCode = "CS0000";
string helpKeyword = "helpKeyword";
Exception e = new Exception ("Inner exception message");
le = new LoggerException (message, e, errorCode, helpKeyword);
le.GetObjectData (si, sc);
Assert.AreEqual (errorCode, si.GetString ("errorCode"), "A1");
Assert.AreEqual (helpKeyword, si.GetString ("helpKeyword"), "A2");
}
}
}

View File

@@ -0,0 +1,51 @@
//
// ProjectFinishedEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class ProjectFinishedEventArgsTest {
[Test]
public void AssignmentTest ()
{
ProjectFinishedEventArgs pfea;
string message = "message";
string helpKeyword = "helpKeyword";
string projectFile = "projectFile";
bool succeeded = true;
pfea = new ProjectFinishedEventArgs (message, helpKeyword, projectFile, succeeded);
Assert.AreEqual (message, pfea.Message, "Message");
Assert.AreEqual (helpKeyword, pfea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (projectFile, pfea.ProjectFile, "ProjectFile");
Assert.AreEqual (succeeded, pfea.Succeeded, "Succeeded");
}
}
}

View File

@@ -0,0 +1,57 @@
//
// ProjectStartedEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using System.Collections;
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class ProjectStartedEventArgsTest {
[Test]
public void AssignmentTest ()
{
ProjectStartedEventArgs psea;
string message = "message";
string helpKeyword = "helpKeyword";
string projectFile = "projectFile";
string targetNames = "targetNames";
string [] properties = new string [2] { "a", "b" };
string [] items = new string [2] { "c", "d" };
psea = new ProjectStartedEventArgs (message, helpKeyword, projectFile, targetNames, properties, items);
Assert.AreEqual (message, psea.Message, "A1");
Assert.AreEqual (helpKeyword, psea.HelpKeyword, "A2");
Assert.AreEqual (projectFile, psea.ProjectFile, "A3");
Assert.AreEqual (targetNames, psea.TargetNames, "A4");
Assert.AreEqual (properties, psea.Properties, "A5");
Assert.AreEqual (items, psea.Items, "A6");
}
}
}

View File

@@ -0,0 +1,55 @@
//
// TargetFinishedEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class TargetFinishedEventArgsTest {
[Test]
public void AssignmentTest ()
{
TargetFinishedEventArgs tfea;
string message = "message";
string helpKeyword = "helpKeyword";
string targetName = "targetName";
string projectFile = "projectFile";
string targetFile = "targetFile";
bool succeeded = true;
tfea = new TargetFinishedEventArgs (message, helpKeyword, targetName, projectFile, targetFile, succeeded);
Assert.AreEqual (message, tfea.Message, "Message");
Assert.AreEqual (helpKeyword, tfea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (targetName, tfea.TargetName, "TargetName");
Assert.AreEqual (projectFile, tfea.ProjectFile, "ProjectFile");
Assert.AreEqual (targetFile, tfea.TargetFile, "TargetFile");
Assert.AreEqual (succeeded, tfea.Succeeded, "Succeeded");
}
}
}

View File

@@ -0,0 +1,53 @@
//
// TargetStartedEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class TargetStartedEventArgsTest {
[Test]
public void AssignmentTest ()
{
TargetStartedEventArgs tsea;
string message = "message";
string helpKeyword = "helpKeyword";
string targetName = "targetName";
string projectFile = "projectFile";
string targetFile = "targetFile";
tsea = new TargetStartedEventArgs (message, helpKeyword, targetName, projectFile, targetFile);
Assert.AreEqual (message, tsea.Message, "Message");
Assert.AreEqual (helpKeyword, tsea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (targetName, tsea.TargetName, "TargetName");
Assert.AreEqual (projectFile, tsea.ProjectFile, "ProjectFile");
Assert.AreEqual (targetFile, tsea.TargetFile, "TargetFile");
}
}
}

View File

@@ -0,0 +1,48 @@
//
// TaskCommandLineEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class TaskCommandLineEventArgsTest {
[Test]
public void TestAssignment ()
{
string commandLine = "commandLine";
string taskName = "taskName";
MessageImportance importance = MessageImportance.High;
TaskCommandLineEventArgs tcle = new TaskCommandLineEventArgs (commandLine, taskName, importance);
Assert.AreEqual (commandLine, tcle.CommandLine, "A1");
Assert.AreEqual (taskName, tcle.TaskName, "A2");
Assert.AreEqual (commandLine, tcle.Message, "A3");
}
}
}

View File

@@ -0,0 +1,55 @@
//
// TaskFinishedEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class TaskFinishedEventArgsTest {
[Test]
public void AssignmentTest ()
{
TaskFinishedEventArgs tfea;
string message = "message";
string helpKeyword = "helpKeyword";
string projectFile = "projectFile";
string taskFile = "taskFile";
string taskName = "taskName";
bool succeeded = true;
tfea = new TaskFinishedEventArgs (message, helpKeyword, projectFile, taskFile, taskName, succeeded);
Assert.AreEqual (message, tfea.Message, "Message");
Assert.AreEqual (helpKeyword, tfea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (projectFile, tfea.ProjectFile, "ProjectFile");
Assert.AreEqual (taskFile, tfea.TaskFile, "TaskFile");
Assert.AreEqual (taskName, tfea.TaskName, "TaskName");
Assert.AreEqual (succeeded, tfea.Succeeded, "Succeeded");
}
}
}

View File

@@ -0,0 +1,53 @@
//
// TaskStartedEventArgsTest.cs:
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
//
// (C) 2005 Marek Sieradzki
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using Microsoft.Build.Framework;
using NUnit.Framework;
namespace MonoTests.Microsoft.Build.Framework {
[TestFixture]
public class TaskStartedEventArgsTest {
[Test]
public void AssignmentTest ()
{
TaskStartedEventArgs tsea;
string message = "message";
string helpKeyword = "helpKeyword";
string projectFile = "projectFile";
string taskFile = "taskFile";
string taskName = "taskName";
tsea = new TaskStartedEventArgs (message, helpKeyword, projectFile, taskFile, taskName);
Assert.AreEqual (message, tsea.Message, "Message");
Assert.AreEqual (helpKeyword, tsea.HelpKeyword, "HelpKeyword");
Assert.AreEqual (projectFile, tsea.ProjectFile, "ProjectFile");
Assert.AreEqual (taskFile, tsea.TaskFile, "TaskFile");
Assert.AreEqual (taskName, tsea.TaskName, "TaskName");
}
}
}