public void CanWrite_WithoutStrategies_ReturnsTrue() { var strategy = new CompundBindablePropertyWriteAccessStrategy(Enumerable.Empty <IBindablePropertyWriteAccessStrategy>()); var result = strategy.CanWrite(_businessObject, _property); Assert.That(result, Is.True); }
public override void SetUp() { base.SetUp(); _mockRepository = new MockRepository(); _innerStrategy1 = _mockRepository.StrictMock <IBindablePropertyWriteAccessStrategy>(); _innerStrategy2 = _mockRepository.StrictMock <IBindablePropertyWriteAccessStrategy>(); _innerStrategy3 = _mockRepository.StrictMock <IBindablePropertyWriteAccessStrategy>(); _strategy = new CompundBindablePropertyWriteAccessStrategy(new[] { _innerStrategy1, _innerStrategy2, _innerStrategy3 }); _businessObjectProvider = CreateBindableObjectProviderWithStubBusinessObjectServiceFactory(); _property = new StubPropertyBase(GetPropertyParameters(GetPropertyInfo(typeof(ClassWithAllDataTypes), "Byte"), _businessObjectProvider)); _businessObject = MockRepository.GenerateStub <IBusinessObject>(); }
public void SetUp() { var bindablePropertyReadAccessStrategy = new CompundBindablePropertyReadAccessStrategy( new IBindablePropertyReadAccessStrategy[] { new BindableDomainObjectPropertyReadAccessStrategy() }); var bindablePropertyWriteAccessStrategy = new CompundBindablePropertyWriteAccessStrategy( new IBindablePropertyWriteAccessStrategy[] { new BindableDomainObjectPropertyWriteAccessStrategy() }); var serviceLocator = DefaultServiceLocator.Create(); serviceLocator.RegisterSingle <IBindablePropertyReadAccessStrategy> (() => bindablePropertyReadAccessStrategy); serviceLocator.RegisterSingle <IBindablePropertyWriteAccessStrategy> (() => bindablePropertyWriteAccessStrategy); _serviceLocatorScope = new ServiceLocatorScope(serviceLocator); _disableAccessChecksBackup = SecurityConfiguration.Current.DisableAccessChecks; SecurityConfiguration.Current.DisableAccessChecks = true; ClientTransaction.CreateRootTransaction().EnterDiscardingScope(); BusinessObjectProvider.SetProvider(typeof(BindableDomainObjectProviderAttribute), null); }