public SetValue ( object newValue ) : void | ||
newValue | object | the object to store |
return | void |
public override void SetValue(object newValue)
{
if (!(newValue is IProxyObject))
{
Context.SetAttribute(_name, newValue);
var disposable = newValue as IDisposable;
if (disposable != null)
{
StepSynchronizationManager.GetContext().RegisterDestructionCallback(_name, new Task(() =>
{
disposable.Dispose();
}));
}
}
}
public void TestSetValue3() { var obj1 = new object(); var obj2 = new object(); var manager = new StepScopeLifetimeManager(); StepSynchronizationManager.Register(_stepExecution1); manager.SetValue(obj1); StepSynchronizationManager.Register(_stepExecution2); manager.SetValue(obj2); var result = manager.GetValue(); Assert.AreEqual(obj2, result); }