Set() public method

Sets the value for a key, removing any other _values that are already in the property set.
public Set ( string key, object value ) : void
key string
value object
return void
コード例 #1
0
ファイル: PropertyBagTests.cs プロジェクト: zzekikaya/nunit
 public void SetAddsNewSingleValue()
 {
     bag.Set("Zip", "ZAP");
     Assert.That(bag["Zip"].Count, Is.EqualTo(1));
     Assert.That(bag["Zip"], Has.Member("ZAP"));
     Assert.That(bag.Get("Zip"), Is.EqualTo("ZAP"));
 }
コード例 #2
0
 public TestParameters(Exception exception)
     : this(RunState.NotRunnable, NoArguments)
 {
     Properties = new PropertyBag();
     Properties.Set(PropertyNames.SkipReason, ExceptionHelper.BuildMessage(exception));
     Properties.Set(PropertyNames.ProviderStackTrace, ExceptionHelper.BuildStackTrace(exception));
 }
コード例 #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));
        }