public new virtual void SetUp() { base.SetUp(); ContentAreaRepository.Stub(x => x.GetById(ContentAreaId)).Return(new ContentArea { ApplicationId = ApplicationId }); CollectionService.Stub(x => x.GetCollectionsForApplication(ApplicationId)) .Return(new List<Collection> { new Collection { } }); try { ContentAreaService.Update(contentArea); } catch (CollectionIdNotPartOfApplicationException ex) { exception = ex; } }
public new virtual void SetUp() { base.SetUp(); var contentArea = new ContentArea { Name = "test", CollectionId = CollectionIdThatIsNotPartOfApplication }; ContentAreaRepository.Stub(x => x.ContentAreasInCollection(CollectionIdThatIsNotPartOfApplication)) .Return(new List<ContentArea>()); CollectionService.Stub(x => x.GetById(CollectionIdThatIsNotPartOfApplication)) .Return(new Collection { Id = CollectionIdThatIsNotPartOfApplication, ApplicationId = ApplicationIdThatDoesNotHaveCollectionId }); try { ContentAreaService.Create(contentArea); } catch (CollectionIdNotPartOfApplicationException ex) { exception = ex; } }