public void SetterIndexerFiresCollectionModifyingEventBeforeModifying() { Guid id = Guid.NewGuid(); IPipe pipe = GetPipe(id); IPipe mockPipe = new Mock<IPipe>(); // assume it is a modified version of 'pipe' _pipes.Add(id, pipe); HelperForCollections helper = new HelperForCollections(); _pipes.Modifying += new PipeCollectionEventHandler<IPipes, PipeCollectionEventArgs>(helper.Modifying_DummyHandler); using (RecordExpectations recorder = RecorderManager.StartRecording()) { new PipeCollectionEventArgs(PipeCollectionEventArgs.CollectionAction.Modify, pipe); recorder.CheckArguments(); helper.Modifying_DummyHandler(null, null); } _pipes[id] = mockPipe; MockManager.Verify(); }
public void SetterIndexerFiresCollectionModifyingEventBeforeModifying() { Guid id = Guid.NewGuid(); IElement el = _dummyFactory.CreateDummyEl(id); IElement mockEl = new Mock<IElement>(); // assume it is a modified version of 'el' _elements.Add(id, el); HelperForCollections helper = new HelperForCollections(); _elements.Modifying += new ElementCollectionEventHandler<IElements, ElementCollectionEventArgs>(helper.Modifying_DummyHandler); using (RecordExpectations recorder = RecorderManager.StartRecording()) { new ElementCollectionEventArgs(ElementCollectionEventArgs.CollectionAction.Modify, el); recorder.CheckArguments(); helper.Modifying_DummyHandler(null, null); } _elements[id] = mockEl; MockManager.Verify(); }