예제 #1
0
        public void Columns_Changed_Called()
        {
            IKeyForm   form  = MockRepository.GenerateMock <IKeyForm>();
            IKey       obj   = MockRepository.GenerateStub <IKey>();
            IMainPanel panel = MockRepository.GenerateMock <IMainPanel>();

            //var presenter = new KeyPresenter(panel, form);
            //presenter.AttachToModel(obj);

            List <IColumn> columns = new List <IColumn>();

            obj.Stub(o => o.Columns).Return(columns.AsReadOnly());

            // Raise the PropertyChanged event for the Columns collection on the Key
            IEventRaiser raiser = obj.GetEventRaiser(e => e.PropertyChanged += null);

            raiser.Raise(obj, new PropertyChangedEventArgs("Columns"));

            form.AssertWasCalled(f => f.Columns = columns);
        }