public void AddModelBindingKey(ModelBindingKey key) { if (_lastBinding != null) { _lastBinding.Add(key); } }
public void AddBindingDetail(ModelBindingKey binding) { if (_currentModelBinding != null) { _currentModelBinding.Add(binding); } }
public void record_model_binding() { report.StartBehavior(inner); report.StartBehavior(inner); report.StartModelBinding(typeof (BinderTarget)); var bindingKey = new ModelBindingKey(); report.AddBindingDetail(bindingKey); Thread.Sleep(100); var target = new object(); report.EndModelBinding(target); var modelBinding = report.Skip(1).First().Skip(1).First().ShouldBeOfType<ModelBindingReport>(); modelBinding.StoredObject.ShouldBeTheSameAs(target); modelBinding.First().ShouldBeTheSameAs(bindingKey); modelBinding.ExecutionTime.ShouldBeGreaterThan(0); }