public void Show_Property_Grid_Called()
        {
            IComponentSpecificationForm form = MockRepository.GenerateMock <IComponentSpecificationForm>();
            ComponentSpecification      obj  = MockRepository.GenerateMock <ComponentSpecification>();
            IMainPanel panel = MockRepository.GenerateMock <IMainPanel>();

            obj.Stub(o => o.ImplementedComponents).Return(new List <Component>().AsReadOnly());
            obj.Stub(o => o.EntitySet).Return(new EntitySetImpl());

            ComponentSpecificationPresenter presenter = new ComponentSpecificationPresenter(panel, form);

            presenter.AttachToModel(obj);
            presenter.Show();

            panel.AssertWasCalled(p => p.ShowPropertyGrid(form));
        }
        public void SetUp()
        {
            ComponentSpecification.Stub(s => s.Create()).Return(new Atom("new atom", null));

            var amendment = new AddComponentAmendment(new[] { 0 }, "new atom");

            this.Visitor.Visit(amendment);
        }
        public void Property_Changed_Registered()
        {
            IComponentSpecificationForm form = MockRepository.GenerateMock <IComponentSpecificationForm>();
            ComponentSpecification      obj  = MockRepository.GenerateMock <ComponentSpecification>();
            IMainPanel panel = MockRepository.GenerateMock <IMainPanel>();

            obj.Stub(o => o.ImplementedComponents).Return(new List <Component>().AsReadOnly());
            obj.Stub(o => o.EntitySet).Return(new EntitySetImpl());

            ComponentSpecificationPresenter presenter = new ComponentSpecificationPresenter(panel, form);

            presenter.AttachToModel(obj);

            obj.AssertWasCalled(o => o.PropertyChanged += null, c => c.IgnoreArguments());
            obj.AssertWasCalled(o => o.ImplementedComponentsChanged += null, c => c.IgnoreArguments());
            obj.AssertWasCalled(o => o.PropertiesChanged            += null, c => c.IgnoreArguments());
        }