public void WhenEntityHasStringPropertyWithoutAllRequiredAttributes_ShouldCreateProperty() { var organisationService = A.Fake <IOrganizationService>(); var client = new CrmPlusPlusCustomizationClient(A.Fake <Publisher>(), A.Fake <Solution>(), organisationService); client.CreateProperty <EntityWithProperties, string>(e => e.StringPropertyWithAllRequiredAttributes); A.CallTo(() => organisationService.Execute(A <OrganizationRequest> ._)).MustHaveHappened(Repeated.Exactly.Once); }
public void WhenEntityHasStringPropertyWithoutInfoAttribute_ShouldThrowInvalidOperationException_AndShouldNotAttemptToCreateProperty() { var organisationService = A.Fake <IOrganizationService>(); var client = new CrmPlusPlusCustomizationClient(A.Fake <Publisher>(), A.Fake <Solution>(), organisationService); Assert.Throws <InvalidOperationException>(() => client.CreateProperty <EntityWithProperties, string>(e => e.StringPropertyWithoutInfoAttribute)); A.CallTo(() => organisationService.Execute(A <OrganizationRequest> ._)).MustNotHaveHappened(); }