public void Form_Events_Are_Attached_To() { IPropertyForm form = MockRepository.GenerateMock <IPropertyForm>(); ComponentProperty obj = MockRepository.GenerateMock <ComponentProperty>(); IMainPanel panel = MockRepository.GenerateMock <IMainPanel>(); //new ComponentPropertyPresenter(panel, form); form.AssertWasCalled(f => f.DatatypeChanged += null, c => c.IgnoreArguments()); form.AssertWasCalled(f => f.PropertyNameChanged += null, c => c.IgnoreArguments()); }
public void Form_Is_Set_Up() { IPropertyForm form = MockRepository.GenerateMock <IPropertyForm>(); ComponentProperty obj = MockRepository.GenerateMock <ComponentProperty>(); IMainPanel panel = MockRepository.GenerateMock <IMainPanel>(); //ComponentPropertyPresenter presenter = new ComponentPropertyPresenter(panel, form); //presenter.AttachToModel(obj); form.AssertWasCalled(f => f.Clear()); form.AssertWasCalled(f => f.ShouldShowIsKeyProperty = false); form.AssertWasCalled(f => f.ShouldShowNullable = false); form.AssertWasCalled(f => f.ShouldShowReadOnly = false); form.AssertWasCalled(f => f.Datatype = obj.Type); form.AssertWasCalled(f => f.PropertyName = obj.Name); form.AssertWasCalled(f => f.SetVirtualProperties(obj.Ex)); form.AssertWasCalled(f => f.SetValidationOptions(obj.ValidationOptions)); }
public void Form_Is_Set_Up() { IPropertyForm form = MockRepository.GenerateMock <IPropertyForm>(); Property obj = MockRepository.GenerateMock <Property>(); IMainPanel panel = MockRepository.GenerateMock <IMainPanel>(); //PropertyPresenter presenter = new PropertyPresenter(panel, form); //presenter.AttachToModel(obj); form.AssertWasCalled(f => f.Clear()); form.AssertWasCalled(f => f.ShouldShowIsKeyProperty = true); form.AssertWasCalled(f => f.ShouldShowReadOnly = true); form.AssertWasCalled(f => f.ShouldShowNullable = true); form.AssertWasCalled(f => f.Datatype = obj.Type); form.AssertWasCalled(f => f.PropertyName = obj.Name); form.AssertWasCalled(f => f.ReadOnly = obj.ReadOnly); form.AssertWasCalled(f => f.IsKeyProperty = obj.IsKeyProperty); //form.AssertWasCalled(f => f.IsVirtual = obj.IsVirtual); form.AssertWasCalled(f => f.IsOveridden = obj.IsInherited); form.AssertWasCalled(f => f.SetVirtualProperties(obj.Ex)); form.AssertWasCalled(f => f.SetValidationOptions(obj.ValidationOptions)); }