nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #01134
[Merge] lp:~saidout/nunit-3.0/compiler-warning-free into lp:nunit-3.0
Said Outgajjouft has proposed merging lp:~saidout/nunit-3.0/compiler-warning-free into lp:nunit-3.0.
Requested reviews:
NUnit Core Developers (nunit-core)
Fixed all warnings in order to get a warning free compilation.
Most of the warnings had to do with missing XML comment.
For most part I added XML comment with a TODO in order for the warnings to go away.
--
https://code.launchpad.net/~saidout/nunit-3.0/compiler-warning-free/+merge/36396
Your team NUnit Core Developers is requested to review the proposed merge of lp:~saidout/nunit-3.0/compiler-warning-free into lp:nunit-3.0.
=== modified file 'src/framework/Api/IPropertyBag.cs'
--- src/framework/Api/IPropertyBag.cs 2010-08-17 19:05:05 +0000
+++ src/framework/Api/IPropertyBag.cs 2010-09-22 22:49:44 +0000
@@ -58,13 +58,7 @@
/// <param name="value">The value</param>
void Add(string key, object value);
- /// <summary>
- /// Add multiple values to the property bag
- /// </summary>
- /// <param name="key">The key</param>
- /// <param name="values">A list of the values</param>
- //void AddEach(string key, IList<object> values);
-
+
/// <summary>
/// Sets the value for a key, removing any other
/// values that are already in the property set.
=== modified file 'src/framework/Api/ITest.cs'
--- src/framework/Api/ITest.cs 2010-08-17 19:05:05 +0000
+++ src/framework/Api/ITest.cs 2010-09-22 22:49:44 +0000
@@ -34,7 +34,7 @@
/// <summary>
/// Gets or sets the id of the test
/// </summary>
- int ID { get; set; }
+ int Id { get; set; }
/// <summary>
/// Gets or sets the name of the test
=== modified file 'src/framework/Api/ITestAssemblyRunner.cs'
--- src/framework/Api/ITestAssemblyRunner.cs 2010-08-17 19:05:05 +0000
+++ src/framework/Api/ITestAssemblyRunner.cs 2010-09-22 22:49:44 +0000
@@ -65,7 +65,8 @@
/// Run selected tests and return a test result. The test is run synchronously,
/// and the listener interface is notified as it progresses.
/// </summary>
- /// <param name="listener">Interface to receive ITestListener notifications.</param>
+ /// <param name="listener">Interface to receive ITestListener notifications.</param>
+ /// <param name="runOptions">TODO Comment for runOptions</param>
ITestResult Run(ITestListener listener, System.Collections.IDictionary runOptions);
#endregion
=== modified file 'src/framework/Api/PropertyEntry.cs'
--- src/framework/Api/PropertyEntry.cs 2010-08-17 19:05:05 +0000
+++ src/framework/Api/PropertyEntry.cs 2010-09-22 22:49:44 +0000
@@ -25,22 +25,32 @@
namespace NUnit.Framework.Api
{
+ /// <summary>
+ /// Immutable class that stores a property entry as a Name/Value pair.
+ /// </summary>
public class PropertyEntry
{
- private string name;
- private object value;
+ private readonly string name;
+ private readonly object value;
+ /// <summary>
+ /// Initializes a new immutable instance of the <see cref="PropertyEntry"/> class.
+ /// </summary>
+ /// <param name="name"></param>
+ /// <param name="value"></param>
public PropertyEntry(string name, object value)
{
this.name = name;
this.value = value;
}
+ /// <summary>Name of the PropertyEntry.</summary>
public string Name
{
get { return name; }
- }
-
+ }
+
+ /// <summary>Value of the PropertyEntry.</summary>
public object Value
{
get { return value; }
=== modified file 'src/framework/Api/TestController.cs'
--- src/framework/Api/TestController.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Api/TestController.cs 2010-09-22 22:49:44 +0000
@@ -261,7 +261,8 @@
/// <summary>
/// Construct a RunTestsAction and run all tests in the loaded TestSuite.
/// </summary>
- /// <param name="controller">A TestController holding the TestSuite to run</param>
+ /// <param name="controller">A TestController holding the TestSuite to run</param>
+ /// <param name="runOptions">TODO Comment for runOptions</param>
/// <param name="callback">A callback used to report results</param>
public RunTestsAction(TestController controller, IDictionary runOptions, AsyncCallback callback)
: base(controller, callback)
=== modified file 'src/framework/Internal/Commands/CommandBuilder.cs'
--- src/framework/Internal/Commands/CommandBuilder.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/CommandBuilder.cs 2010-09-22 22:49:44 +0000
@@ -22,13 +22,20 @@
// ***********************************************************************
using System;
-using System.Reflection;
using NUnit.Framework.Api;
namespace NUnit.Framework.Internal
{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class CommandBuilder
{
+ /// <summary>
+ /// TODO: Documentation needed for method
+ /// </summary>
+ /// <param name="test"></param>
+ /// <returns></returns>
public static TestCommand MakeTestCommand(Test test)
{
if (test.RunState != RunState.Runnable && test.RunState != RunState.Explicit)
@@ -41,6 +48,11 @@
return MakeTestCommand(test as TestMethod);
}
+ /// <summary>
+ /// TODO: Documentation needed for method
+ /// </summary>
+ /// <param name="test"></param>
+ /// <returns></returns>
public static TestCommand MakeTestCommand(TestMethod test)
{
if (test == null)
@@ -70,6 +82,11 @@
return command;
}
+ /// <summary>
+ /// TODO: Documentation needed for method
+ /// </summary>
+ /// <param name="suite"></param>
+ /// <returns></returns>
public static TestCommand MakeTestCommand(TestSuite suite)
{
if (suite == null)
=== modified file 'src/framework/Internal/Commands/DelegatingTestCommand.cs'
--- src/framework/Internal/Commands/DelegatingTestCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/DelegatingTestCommand.cs 2010-09-22 22:49:44 +0000
@@ -21,21 +21,29 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************
-using System;
-using NUnit.Framework.Api;
-
namespace NUnit.Framework.Internal
-{
+{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public abstract class DelegatingTestCommand : TestCommand
{
- protected TestCommand innerCommand;
-
- public DelegatingTestCommand(TestCommand innerCommand)
+ /// <summary>TODO: Documentation needed for field</summary>
+ protected TestCommand innerCommand;
+
+ /// <summary>
+ /// TODO: Documentation needed for constructor
+ /// </summary>
+ /// <param name="innerCommand"></param>
+ protected DelegatingTestCommand(TestCommand innerCommand)
: base(innerCommand.Test)
{
this.innerCommand = innerCommand;
}
+ /// <summary>
+ /// TODO: Documentation needed for property
+ /// </summary>
public override TestResult Result
{
get
@@ -48,4 +56,4 @@
}
}
}
-}
+}
\ No newline at end of file
=== modified file 'src/framework/Internal/Commands/ExpectedExceptionCommand.cs'
--- src/framework/Internal/Commands/ExpectedExceptionCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/ExpectedExceptionCommand.cs 2010-09-22 22:49:44 +0000
@@ -27,15 +27,17 @@
namespace NUnit.Framework.Internal
{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class ExpectedExceptionCommand : DelegatingTestCommand
{
- private ExpectedExceptionProcessor exceptionProcessor;
+ private readonly ExpectedExceptionProcessor exceptionProcessor;
/// <summary>
/// Initializes a new instance of the <see cref="ExpectedExceptionCommand"/> class.
/// </summary>
/// <param name="innerCommand">The inner command.</param>
- /// <param name="exceptionProcessor">The exception processor.</param>
public ExpectedExceptionCommand(TestCommand innerCommand)
: base(innerCommand)
{
@@ -71,5 +73,4 @@
return Result;
}
}
-
-}
+}
\ No newline at end of file
=== modified file 'src/framework/Internal/Commands/MaxTimeCommand.cs'
--- src/framework/Internal/Commands/MaxTimeCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/MaxTimeCommand.cs 2010-09-22 22:49:44 +0000
@@ -26,15 +26,18 @@
namespace NUnit.Framework.Internal
{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class MaxTimeCommand : DelegatingTestCommand
{
private int maxTime;
/// <summary>
- /// Initializes a new instance of the <see cref="MaxTimeCommand"/> class.
+ /// Initializes a new instance of the <see cref="MaxTimeCommand"/> class.
+ /// TODO: Add a comment about where the max time is retrieved.
/// </summary>
/// <param name="innerCommand">The inner command.</param>
- /// <param name="maxTime">The max time.</param>
public MaxTimeCommand(TestCommand innerCommand)
: base(innerCommand)
{
@@ -70,4 +73,4 @@
return testResult;
}
}
-}
+}
\ No newline at end of file
=== modified file 'src/framework/Internal/Commands/RepeatedTestCommand.cs'
--- src/framework/Internal/Commands/RepeatedTestCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/RepeatedTestCommand.cs 2010-09-22 22:49:44 +0000
@@ -21,20 +21,22 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************
-using System;
using NUnit.Framework.Api;
namespace NUnit.Framework.Internal
{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class RepeatedTestCommand : DelegatingTestCommand
{
private int repeatCount;
/// <summary>
- /// Initializes a new instance of the <see cref="RepeatedTestCommand"/> class.
+ /// Initializes a new instance of the <see cref="RepeatedTestCommand"/> class.
+ /// TODO: Add a comment about where the repeat count is retrieved.
/// </summary>
- /// <param name="innerCommand">The inner command.</param>
- /// <param name="repeatCount">The repeat count.</param>
+ /// <param name="innerCommand">The inner command.</param>
public RepeatedTestCommand(TestCommand innerCommand)
: base(innerCommand)
{
=== modified file 'src/framework/Internal/Commands/SetUpTearDownCommand.cs'
--- src/framework/Internal/Commands/SetUpTearDownCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/SetUpTearDownCommand.cs 2010-09-22 22:49:44 +0000
@@ -27,11 +27,14 @@
using NUnit.Framework.Api;
namespace NUnit.Framework.Internal
-{
+{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class SetUpTearDownCommand : DelegatingTestCommand
{
- private MethodInfo[] setUpMethods;
- private MethodInfo[] tearDownMethods;
+ private readonly MethodInfo[] setUpMethods;
+ private readonly MethodInfo[] tearDownMethods;
/// <summary>
/// Initializes a new instance of the <see cref="SetUpTearDownCommand"/> class.
=== modified file 'src/framework/Internal/Commands/SkipCommand.cs'
--- src/framework/Internal/Commands/SkipCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/SkipCommand.cs 2010-09-22 22:49:44 +0000
@@ -26,6 +26,9 @@
namespace NUnit.Framework.Internal
{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class SkipCommand : TestCommand
{
/// <summary>
@@ -66,4 +69,4 @@
return testResult;
}
}
-}
+}
\ No newline at end of file
=== modified file 'src/framework/Internal/Commands/TestCaseCommand.cs'
--- src/framework/Internal/Commands/TestCaseCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/TestCaseCommand.cs 2010-09-22 22:49:44 +0000
@@ -21,21 +21,21 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************
-using System;
-using System.Reflection;
using NUnit.Framework.Api;
namespace NUnit.Framework.Internal
{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class TestCaseCommand : TestCommand
{
- private TestMethod testMethod;
+ private readonly TestMethod testMethod;
/// <summary>
/// Initializes a new instance of the <see cref="TestCaseCommand"/> class.
/// </summary>
/// <param name="test">The test.</param>
- /// <param name="arguments">The arguments.</param>
public TestCaseCommand(Test test) : base(test)
{
this.testMethod = test as TestMethod;
@@ -59,4 +59,4 @@
return Result;
}
}
-}
+}
\ No newline at end of file
=== modified file 'src/framework/Internal/Commands/TestCommand.cs'
--- src/framework/Internal/Commands/TestCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/TestCommand.cs 2010-09-22 22:49:44 +0000
@@ -37,13 +37,16 @@
public abstract class TestCommand : ITestCommand
{
private Test test;
- private TestResult result;
#if CLR_2_0 || CLR_4_0
private IList<ITestCommand> children;
#else
private IList children;
#endif
+ /// <summary>
+ /// TODO: Documentation needed for constructor
+ /// </summary>
+ /// <param name="test"></param>
public TestCommand(Test test)
{
this.test = test;
@@ -51,16 +54,19 @@
#region Public Properties and Methods
+ /// <summary>
+ /// TODO: Documentation needed for property
+ /// </summary>
public Test Test
{
get { return test; }
}
- /// <summary>
- /// Gets any child TestCommands of this command
- /// </summary>
+#if CLR_2_0 || CLR_4_0
+ /// <summary>
+ /// Gets any child TestCommands of this command
+ /// </summary>
/// <value>A list of child TestCommands</value>
-#if CLR_2_0 || CLR_4_0
public IList<ITestCommand> Children
{
get
@@ -95,6 +101,9 @@
#region Protected Properties
+ /// <summary>
+ /// TODO: Documentation needed for property
+ /// </summary>
public virtual TestResult Result
{
get
@@ -107,38 +116,6 @@
}
}
- /// <summary>
- /// Gets the result which is currently being built for this test.
- /// Returns null if accessed before the test begins execution.
- /// </summary>
- //protected TestResult CurrentResult
- //{
- // get
- // {
- // return TestExecutionContext.CurrentContext.CurrentResult;
- // }
- // set
- // {
- // TestExecutionContext.CurrentContext.CurrentResult = value;
- // }
- //}
-
- /// <summary>
- /// Gets the test for which this command was created. Since the
- /// value is stored in the TestExecutionContext, it may only be
- /// used during execution of the command. At other times, such
- /// as when the command is being constructed, it returns null,
- /// so any constructors that need the test should take it as
- /// an argument.
- /// </summary>
- //protected Test CurrentTest
- //{
- // get
- // {
- // return TestExecutionContext.CurrentContext.CurrentTest;
- // }
- //}
-
#endregion
}
}
=== modified file 'src/framework/Internal/Commands/TestExecutionContextCommand.cs'
--- src/framework/Internal/Commands/TestExecutionContextCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/TestExecutionContextCommand.cs 2010-09-22 22:49:44 +0000
@@ -2,13 +2,25 @@
namespace NUnit.Framework.Internal
{
+ ///<summary>
+ /// TODO: Documentation needed for class
+ ///</summary>
public class TestExecutionContextCommand : DelegatingTestCommand
{
+ /// <summary>
+ /// TODO: Documentation needed for constructor
+ /// </summary>
+ /// <param name="innerCommand"></param>
public TestExecutionContextCommand(TestCommand innerCommand)
: base(innerCommand)
{
}
+ /// <summary>
+ /// TODO: Documentation needed for constructor
+ /// </summary>
+ /// <param name="testObject"></param>
+ /// <returns></returns>
public override TestResult Execute(object testObject)
{
TestExecutionContext.Save();
=== modified file 'src/framework/Internal/Commands/TestGroupCommand.cs'
--- src/framework/Internal/Commands/TestGroupCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/TestGroupCommand.cs 2010-09-22 22:49:44 +0000
@@ -2,18 +2,25 @@
using NUnit.Framework.Api;
namespace NUnit.Framework.Internal
-{
+{
+ ///<summary>
+ /// TODO: Documentation needed for class
+ ///</summary>
public class TestGroupCommand : TestCommand
{
+ /// <summary>
+ /// TODO: Documentation needed for constructor
+ /// </summary>
+ /// <param name="test"></param>
public TestGroupCommand(Test test) : base(test)
{
}
- //public TestGroupCommand(TestSuite suite, IList<TestCommand> commands)
- //{
- // this.commands = commands;
- //}
-
+ /// <summary>
+ /// TODO: Documentation needed for method
+ /// </summary>
+ /// <param name="testObject"></param>
+ /// <returns></returns>
public override TestResult Execute(object testObject)
{
Result.SetResult(ResultState.Success);
=== modified file 'src/framework/Internal/Commands/TestMethodCommand.cs'
--- src/framework/Internal/Commands/TestMethodCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/TestMethodCommand.cs 2010-09-22 22:49:44 +0000
@@ -28,6 +28,9 @@
namespace NUnit.Framework.Internal
{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class TestMethodCommand : DelegatingTestCommand
{
#region Fields
@@ -35,7 +38,7 @@
/// <summary>
/// The TestMethod for which this is built
/// </summary>
- private TestMethod test;
+ private readonly TestMethod test;
/// <summary>
/// The test method
@@ -52,7 +55,6 @@
/// </summary>
private MethodInfo[] tearDownMethods;
- private ITestListener listener;
#endregion
@@ -60,11 +62,10 @@
/// Initializes a new instance of the <see cref="TestMethodCommand"/> class.
/// </summary>
/// <param name="innerCommand">The inner command.</param>
- /// <param name="test">The test.</param>
public TestMethodCommand(TestCommand innerCommand)
: base(innerCommand)
{
- this.test = Test as TestMethod;
+ this.test = Test as TestMethod;
this.method = test.Method;
}
=== modified file 'src/framework/Internal/Commands/TestSuiteCommand.cs'
--- src/framework/Internal/Commands/TestSuiteCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/TestSuiteCommand.cs 2010-09-22 22:49:44 +0000
@@ -3,18 +3,30 @@
using NUnit.Framework.Api;
namespace NUnit.Framework.Internal
-{
+{
+ ///<summary>
+ /// TODO: Documentation needed for class
+ ///</summary>
public class TestSuiteCommand : TestCommand
{
- private TestSuite suite;
- private Type fixtureType;
-
+ private readonly TestSuite suite;
+ private readonly Type fixtureType;
+
+ /// <summary>
+ /// TODO: Documentation needed for constructor
+ /// </summary>
+ /// <param name="test"></param>
public TestSuiteCommand(Test test) : base(test)
{
this.suite = Test as TestSuite;
this.fixtureType = Test.FixtureType;
}
+ /// <summary>
+ /// TODO: Documentation needed for method
+ /// </summary>
+ /// <param name="testObject"></param>
+ /// <returns></returns>
public override TestResult Execute(object testObject)
{
try
@@ -78,8 +90,8 @@
/// <summary>
/// Does the one time tear down.
- /// </summary>
- /// <param name="suiteResult">The suite result.</param>
+ /// </summary>
+ /// <param name="testObject"></param>
protected virtual void DoOneTimeTearDown(object testObject)
{
if (fixtureType != null)
@@ -165,7 +177,7 @@
return Result;
}
- private bool IsStaticClass(Type type)
+ private static bool IsStaticClass(Type type)
{
return type.IsAbstract && type.IsSealed;
}
=== modified file 'src/framework/Internal/Commands/ThreadedTestCommand.cs'
--- src/framework/Internal/Commands/ThreadedTestCommand.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Commands/ThreadedTestCommand.cs 2010-09-22 22:49:44 +0000
@@ -28,6 +28,9 @@
namespace NUnit.Framework.Internal
{
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class ThreadedTestCommand : DelegatingTestCommand
{
private object testObject;
=== modified file 'src/framework/Internal/DefaultTestAssemblyRunner.cs'
--- src/framework/Internal/DefaultTestAssemblyRunner.cs 2010-08-19 22:59:46 +0000
+++ src/framework/Internal/DefaultTestAssemblyRunner.cs 2010-09-22 22:49:44 +0000
@@ -29,6 +29,9 @@
#region Properties
+ /// <summary>
+ /// TODO: Documentation needed for property
+ /// </summary>
public ITest LoadedTest
{
get
=== modified file 'src/framework/Internal/ParameterSet.cs'
--- src/framework/Internal/ParameterSet.cs 2010-08-14 02:11:08 +0000
+++ src/framework/Internal/ParameterSet.cs 2010-09-22 22:49:44 +0000
@@ -104,14 +104,6 @@
}
#if !NUNITLITE
- /// <summary>
- /// The reason for not running the test case
- /// represented by this ParameterSet
- /// </summary>
- //public string NotRunReason
- //{
- // get { return (string)Properties[PropertyNames.IgnoreReason]; }
- //}
/// <summary>
/// The Type of any exception that is expected.
=== modified file 'src/framework/Internal/PropertyBag.cs'
--- src/framework/Internal/PropertyBag.cs 2010-08-17 19:05:05 +0000
+++ src/framework/Internal/PropertyBag.cs 2010-09-22 22:49:44 +0000
@@ -129,12 +129,20 @@
: (int)value;
}
- public System.Enum GetSetting(string key, System.Enum defaultValue)
+ /// <summary>
+ /// Gets a single Enum value for a key, using the first
+ /// one if multiple values are present and returning the
+ /// default value if no entry is found.
+ /// </summary>
+ /// <param name="key"></param>
+ /// <param name="defaultValue"></param>
+ /// <returns></returns>
+ public Enum GetSetting(string key, Enum defaultValue)
{
object value = Get(key);
return value == null
? defaultValue
- : (System.Enum)value;
+ : (Enum)value;
}
/// <summary>
@@ -345,6 +353,10 @@
#region Nested PropertyBagEnumerator Class
#if CLR_2_0 || CLR_4_0
+
+ /// <summary>
+ /// TODO: Documentation needed for class
+ /// </summary>
public class PropertyBagEnumerator : IEnumerator<PropertyEntry>
{
private IEnumerator<KeyValuePair<string, IList>> innerEnum;
@@ -356,6 +368,10 @@
private PropertyBag bag;
private IEnumerator valueEnum;
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="bag"></param>
public PropertyBagEnumerator(PropertyBag bag)
{
this.bag = bag;
=== modified file 'src/framework/Internal/TestProgressReporter.cs'
--- src/framework/Internal/TestProgressReporter.cs 2010-01-22 22:22:09 +0000
+++ src/framework/Internal/TestProgressReporter.cs 2010-09-22 22:49:44 +0000
@@ -65,7 +65,7 @@
try
{
XmlNode node = XmlHelper.CreateTopLevelElement("start");
- XmlHelper.AddAttribute(node, "id", test.ID.ToString());
+ XmlHelper.AddAttribute(node, "id", test.Id.ToString());
XmlHelper.AddAttribute(node, "name", test.Name);
XmlHelper.AddAttribute(node, "fullname", test.FullName);
callback(new ProgressReport(node));
=== modified file 'src/framework/Internal/Tests/SetUpFixture.cs'
--- src/framework/Internal/Tests/SetUpFixture.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Tests/SetUpFixture.cs 2010-09-22 22:49:44 +0000
@@ -71,21 +71,5 @@
return methods;
}
#endregion
-
- #region TestSuite Overrides
- /// <summary>
- /// Runs the suite under a particular filter, sending
- /// notifications to a listener.
- /// </summary>
- /// <param name="listener">An event listener to receive notifications</param>
- /// <returns></returns>
- //public override TestResult Run(ITestListener listener)
- //{
- // using ( new DirectorySwapper( AssemblyHelper.GetDirectoryName( FixtureType.Assembly ) ) )
- // {
- // return base.Run(listener);
- // }
- //}
- #endregion
- }
+ }
}
=== modified file 'src/framework/Internal/Tests/Test.cs'
--- src/framework/Internal/Tests/Test.cs 2010-08-29 16:03:15 +0000
+++ src/framework/Internal/Tests/Test.cs 2010-09-22 22:49:44 +0000
@@ -135,6 +135,10 @@
this.runState = RunState.Runnable;
}
+ /// <summary>
+ /// TODO: Documentation needed for constructor
+ /// </summary>
+ /// <param name="fixtureType"></param>
protected Test(Type fixtureType) : this(fixtureType.FullName)
{
this.fixtureType = fixtureType;
@@ -148,7 +152,7 @@
/// Gets or sets the id of the test
/// </summary>
/// <value></value>
- public int ID
+ public int Id
{
get { return id; }
set { id = value; }
@@ -265,9 +269,15 @@
return thisNode;
}
+
+ /// <summary>
+ /// TODO: Documentation needed for method
+ /// </summary>
+ /// <param name="thisNode"></param>
+ /// <param name="recursive"></param>
protected void PopulateTestNode(XmlNode thisNode, bool recursive)
{
- XmlHelper.AddAttribute(thisNode, "id", this.ID.ToString());
+ XmlHelper.AddAttribute(thisNode, "id", this.Id.ToString());
XmlHelper.AddAttribute(thisNode, "name", this.Name);
XmlHelper.AddAttribute(thisNode, "fullname", this.FullName);
@@ -529,10 +539,24 @@
#region Nested Classes
#if CLR_2_0 || CLR_4_0
+ /// <summary>
+ /// CategoryList is a collection of strings which derives from List<string>.
+ /// </summary>
+ /// <remarks>
+ /// CategoryList base type is dependent on the .NET CLR it's compiled for.
+ /// For CLR 2.0/4.0 it's based on a List<string> and for CLR 1.0/1.1 it's based on an ArrayList.
+ /// </remarks>
public class CategoryList : System.Collections.Generic.List<string> { }
#else
+ /// <summary>
+ /// CategoryList is a collection of strings which derives from ArrayList.
+ /// </summary>
+ /// <remarks>
+ /// CategoryList base type is dependent on the .NET CLR it's compiled for.
+ /// For CLR 2.0/4.0 it's based on a List<string> and for CLR 1.0/1.1 it's based on an ArrayList.
+ /// </remarks>
public class CategoryList : System.Collections.ArrayList { }
-#endif
- #endregion
+#endif
+ #endregion
}
}
=== modified file 'src/framework/TestContext.cs'
--- src/framework/TestContext.cs 2010-08-14 02:11:08 +0000
+++ src/framework/TestContext.cs 2010-09-22 22:49:44 +0000
@@ -110,7 +110,7 @@
/// </summary>
public int ID
{
- get { return test.ID; }
+ get { return test.Id; }
}
/// <summary>
=== modified file 'src/tests/Attributes/TestDummy.cs'
--- src/tests/Attributes/TestDummy.cs 2010-08-17 19:05:05 +0000
+++ src/tests/Attributes/TestDummy.cs 2010-09-22 22:49:44 +0000
@@ -34,7 +34,7 @@
#region ITest Members
- public int ID
+ public int Id
{
get
{
=== modified file 'src/tests/Attributes/TheoryTests.cs'
--- src/tests/Attributes/TheoryTests.cs 2010-04-16 23:23:50 +0000
+++ src/tests/Attributes/TheoryTests.cs 2010-09-22 22:49:44 +0000
@@ -31,7 +31,7 @@
{
public class TheoryTests
{
- static Type fixtureType = typeof(TheoryFixture);
+ static readonly Type fixtureType = typeof(TheoryFixture);
[Test]
public void TheoryWithNoArgumentsIsTreatedAsTest()
@@ -66,8 +66,6 @@
{
}
- [Datapoint]
- object objData = null;
[Test]
public void EnumArgumentsAreSuppliedAutomatically()
@@ -107,7 +105,7 @@
Assert.That(s.StartsWith("xyz"));
}
- private void SquareRootTest(double d)
+ private static void SquareRootTest(double d)
{
Assume.That(d > 0);
double root = Math.Sqrt(d);
=== modified file 'src/tests/Internal/TestXmlTests.cs'
--- src/tests/Internal/TestXmlTests.cs 2010-08-17 19:05:05 +0000
+++ src/tests/Internal/TestXmlTests.cs 2010-09-22 22:49:44 +0000
@@ -100,7 +100,7 @@
Assert.That(topNode.Name, Is.EqualTo(test.ElementName));
- Assert.That(topNode.Attributes["id"].Value, Is.EqualTo(test.ID.ToString()));
+ Assert.That(topNode.Attributes["id"].Value, Is.EqualTo(test.Id.ToString()));
Assert.That(topNode.Attributes["name"].Value, Is.EqualTo(test.Name));
Assert.That(topNode.Attributes["fullname"].Value, Is.EqualTo(test.FullName));
@@ -137,9 +137,9 @@
{
foreach (Test child in suite.Tests)
{
- string xpathQuery = string.Format("{0}[@id={1}]", child.ElementName, child.ID);
+ string xpathQuery = string.Format("{0}[@id={1}]", child.ElementName, child.Id);
XmlNode childNode = topNode.SelectSingleNode(xpathQuery);
- Assert.NotNull(childNode, "Expected node for test with ID={0}, Name={1}", child.ID, child.Name);
+ Assert.NotNull(childNode, "Expected node for test with ID={0}, Name={1}", child.Id, child.Name);
CheckXmlForTest(child, childNode, recursive);
}
=== modified file 'src/tests/Syntax/TestCompiler.cs'
--- src/tests/Syntax/TestCompiler.cs 2010-08-02 02:42:35 +0000
+++ src/tests/Syntax/TestCompiler.cs 2010-09-22 22:49:44 +0000
@@ -26,11 +26,11 @@
namespace NUnit.Framework.Syntax
{
- class TestCompiler
- {
- Microsoft.CSharp.CSharpCodeProvider provider;
-#if !CLR_2_0 || CLR_4_0
- ICodeCompiler compiler;
+ internal class TestCompiler
+ {
+ private readonly Microsoft.CSharp.CSharpCodeProvider provider;
+#if !CLR_2_0 && !CLR_4_0
+ private readonly ICodeCompiler compiler;
#endif
CompilerParameters options;
@@ -40,11 +40,11 @@
public TestCompiler( string[] assemblyNames, string outputName )
{
- this.provider = new Microsoft.CSharp.CSharpCodeProvider();
-#if !CLR_2_0 || CLR_4_0
+ this.provider = new Microsoft.CSharp.CSharpCodeProvider();
+#if !CLR_2_0 && !CLR_4_0
this.compiler = provider.CreateCompiler();
-#endif
- this.options = new CompilerParameters();
+#endif
+ this.options = new CompilerParameters();
if ( assemblyNames != null && assemblyNames.Length > 0 )
options.ReferencedAssemblies.AddRange( assemblyNames );
Follow ups