public static BusinessObjectIconWebServiceContext Create(IBusinessObjectClassWithIdentity businessObjectClass, string arguments) { if (businessObjectClass == null) { return(null); } return(new BusinessObjectIconWebServiceContext(businessObjectClass.Identifier, StringUtility.EmptyToNull(arguments))); }
private IBusinessObjectReferenceProperty GetReferenceProperty( string businessObjectProperty, IBusinessObjectClassWithIdentity businessObjectClassWithIdentity) { var propertyDefinition = businessObjectClassWithIdentity.GetPropertyDefinition(businessObjectProperty); Assertion.IsNotNull(propertyDefinition); Assertion.IsTrue(propertyDefinition is IBusinessObjectReferenceProperty); return((IBusinessObjectReferenceProperty)propertyDefinition); }
protected IBusinessObjectClassWithIdentity GetBusinessObjectClass() { IBusinessObjectClassWithIdentity businessObjectClass = null; if (Property != null) { businessObjectClass = (IBusinessObjectClassWithIdentity)Property.ReferenceClass; } else if (DataSource != null) { businessObjectClass = (IBusinessObjectClassWithIdentity)DataSource.BusinessObjectClass; } return(businessObjectClass); }
public void WithoutSearchServiceAttribute_AndNoDefaultSearchService_FromPropertyType() { IBusinessObjectClassService businessObjectClassServiceMock = _mockRepository.StrictMock <IBusinessObjectClassService> (); IBusinessObjectProvider businessObjectProviderMock = _mockRepository.StrictMock <IBusinessObjectProvider> (); IBusinessObjectClassWithIdentity businessObjectClassWithIdentityMock = _mockRepository.StrictMock <IBusinessObjectClassWithIdentity> (); IBusinessObjectReferenceProperty property = CreatePropertyWithoutMixing("NoSearchService"); Expect.Call(businessObjectClassWithIdentityMock.BusinessObjectProvider).Return(businessObjectProviderMock).Repeat.Any(); Expect.Call(businessObjectProviderMock.GetService(typeof(ISearchAvailableObjectsService))).Return(null); Expect.Call(businessObjectClassServiceMock.GetBusinessObjectClass(typeof(ClassFromOtherBusinessObjectImplementation))) .Return(businessObjectClassWithIdentityMock); _mockRepository.ReplayAll(); _bindableObjectProviderForDeclaringType.AddService(businessObjectClassServiceMock); _mockRepository.VerifyAll(); Assert.That(property.SupportsSearchAvailableObjects, Is.False); }
public void SetUp() { _mockRepository = new MockRepository(); var businessObjectProviderStub = MockRepository.GenerateStub <IBusinessObjectProvider>(); businessObjectProviderStub.Stub(_ => _.GetNotAccessiblePropertyStringPlaceHolder()).Return("X"); _businessObjectClassWithIdentityStub = MockRepository.GenerateStub <IBusinessObjectClassWithIdentity>(); _businessObjectClassWithIdentityStub.Stub(_ => _.BusinessObjectProvider).Return(businessObjectProviderStub); _businessObjectWithIdentityMock = _mockRepository.StrictMock <IBusinessObjectWithIdentity>(); _businessObjectWithIdentityMock.Stub(_ => _.BusinessObjectClass).Return(_businessObjectClassWithIdentityStub); _propertyMock = _mockRepository.StrictMock <IBusinessObjectProperty>(); _propertyMock.Stub(_ => _.Identifier).Return("Property"); _result = new EvaluatedBusinessObjectPropertyPathResult(_businessObjectWithIdentityMock, _propertyMock); }