A PropertyBag represents a collection of name value pairs that allows duplicate entries with the same key. Methods are provided for adding a new pair as well as for setting a key to a single value. All keys are strings but _values may be of any type. Null _values are not permitted, since a null entry represents the absence of the key.
Inheritance: IPropertyBag
コード例 #1
0
 /// <summary>
 /// Construct with a object[] representing a set of arguments. 
 /// In .NET 2.0, the arguments may later be separated into
 /// type arguments and constructor arguments.
 /// </summary>
 /// <param name="arguments"></param>
 public TestFixtureAttribute(params object[] arguments)
 {
     RunState = RunState.Runnable;
     Arguments = arguments;
     TypeArgs = new Type[0];
     Properties = new PropertyBag();
 }
コード例 #2
0
ファイル: PropertyBagTests.cs プロジェクト: alfeg/nunit
 public void SetUp()
 {
     bag = new PropertyBag();
     bag.Add("Answer", 42);
     bag.Add("Tag", "bug");
     bag.Add("Tag", "easy");
 }
コード例 #3
0
ファイル: TestParameters.cs プロジェクト: alfeg/nunit
        /// <summary>
        /// Construct a non-runnable ParameterSet, specifying
        /// the provider exception that made it invalid.
        /// </summary>
        public TestParameters(Exception exception)
        {
            RunState = RunState.NotRunnable;
            Properties = new PropertyBag();

            Properties.Set(PropertyNames.SkipReason, ExceptionHelper.BuildMessage(exception));
            Properties.Set(PropertyNames.ProviderStackTrace, ExceptionHelper.BuildStackTrace(exception));
        }
コード例 #4
0
ファイル: TestCaseAttribute.cs プロジェクト: jlewicki/nunit
        /// <summary>
        /// Construct a TestCaseAttribute with a list of arguments.
        /// This constructor is not CLS-Compliant
        /// </summary>
        /// <param name="arguments"></param>
        public TestCaseAttribute(params object[] arguments)
        {
            RunState = RunState.Runnable;
            
            if (arguments == null)
                Arguments = new object[] { null };
            else
                Arguments = arguments;

            Properties = new PropertyBag();
        }
コード例 #5
0
ファイル: TestParameters.cs プロジェクト: alfeg/nunit
        /// <summary>
        /// Construct a ParameterSet from an object implementing ITestData
        /// </summary>
        /// <param name="data"></param>
        public TestParameters(ITestData data)
        {
            RunState = data.RunState;
            Properties = new PropertyBag();

            TestName = data.TestName;
            OriginalArguments = Arguments = data.Arguments;

            foreach (string key in data.Properties.Keys)
                this.Properties[key] = data.Properties[key];
        }
コード例 #6
0
ファイル: TestParameters.cs プロジェクト: mjedrzejek/nunit
        /// <summary>
        /// Construct a ParameterSet from an object implementing ITestData
        /// </summary>
        /// <param name="data"></param>
        public TestParameters(ITestData data)
        {
            RunState = data.RunState;
            Properties = new PropertyBag();

            TestName = data.TestName;

            InitializeAguments(data.Arguments);

            foreach (string key in data.Properties.Keys)
                this.Properties[key] = data.Properties[key];
        }
コード例 #7
0
ファイル: TestCaseAttribute.cs プロジェクト: jlewicki/nunit
 /// <summary>
 /// Construct a TestCaseAttribute with a three arguments
 /// </summary>
 /// <param name="arg1"></param>
 /// <param name="arg2"></param>
 /// <param name="arg3"></param>
 public TestCaseAttribute(object arg1, object arg2, object arg3)
 {
     RunState = RunState.Runnable;			
     Arguments = new object[] { arg1, arg2, arg3 };
     Properties = new PropertyBag();
 }
コード例 #8
0
ファイル: Test.cs プロジェクト: nunit/nunit
 private void Initialize(string name)
 {
     FullName = Name = name;
     Id = GetNextId();
     Properties = new PropertyBag();
     RunState = RunState.Runnable;
 }
コード例 #9
0
 /// <summary>
 /// Construct a TestCaseAttribute with a single argument
 /// </summary>
 /// <param name="arg"></param>
 public TestCaseDumbAttribute(object arg)
 {
     RunState = RunState.Runnable;
     Arguments = new object[] { arg };
     Properties = new PropertyBag();
 }
コード例 #10
0
ファイル: TestParameters.cs プロジェクト: alfeg/nunit
 /// <summary>
 /// Construct a parameter set with a list of arguments
 /// </summary>
 /// <param name="args"></param>
 public TestParameters(object[] args)
 {
     RunState = RunState.Runnable;
     Properties = new PropertyBag();
     OriginalArguments = Arguments = args;
 }
コード例 #11
0
ファイル: TestParameters.cs プロジェクト: alfeg/nunit
 /// <summary>
 /// Default Constructor creates an empty parameter set
 /// </summary>
 public TestParameters()
 {
     RunState = RunState.Runnable;
     Properties = new PropertyBag();
 }
コード例 #12
0
ファイル: TestParameters.cs プロジェクト: mjedrzejek/nunit
 /// <summary>
 /// Construct a parameter set with a list of arguments
 /// </summary>
 /// <param name="args"></param>
 public TestParameters(object[] args)
 {
     RunState = RunState.Runnable;
     InitializeAguments(args);
     Properties = new PropertyBag();
 }