public new virtual void SetUp()
 {
     SystemSettings.ApiKey.Returns(ApiKey);
     ContentAreasServiceAgent.GetByCollectionNameAndApiKey(ApiKey, CollectionName).Returns(contentAreas);
     LabelCollectionMapper.Map(contentAreas).Returns(mappedValueFromServiceAgent);
     result = LabelCollectionRetriever.Get(CollectionName);
 }
 public new virtual void SetUp()
 {
     base.SetUp();
     ContentAreasServiceAgent.GetByCollectionNameAndApiKey(ApiKey, CollectionName)
     .Returns(x => { throw new ApiKeyNotValidException(); });
     SystemSettings.ApiKey.Returns(ApiKey);
     _result = LabelCollectionRetriever.Get(CollectionName);
 }
 public virtual void SetUp()
 {
     LabelCollectionMapper    = Substitute.For <ILabelCollectionMapper>();
     ContentAreasServiceAgent = Substitute.For <IContentAreasServiceAgent>();
     SystemSettings           = Substitute.For <ISystemSettings>();
     Logger = Substitute.For <ILogger>();
     LabelCollectionRetriever = new LabelCollectionRetriever(LabelCollectionMapper, ContentAreasServiceAgent, SystemSettings, Logger);
 }
 public new virtual void SetUp()
 {
     base.SetUp();
     ApplicationService.GetByOrganisationId().Returns(_applicationsFromService);
     OrganisationService.Get().Returns(_organisationFromService);
     LabelCollectionRetriever.Get("DashboardPage").Returns(_labelsFromCollectionRetriever);
     _result = DashboardViewModelGetter.Get();
 }
 public new virtual void SetUp()
 {
     base.SetUp();
     LabelCollectionRetriever.Get("ApplicationPage").Returns(_labelsFromRetreiever);
     _applicationFromService = new Application {
         Id = ValidApplicationId
     };
     CollectionService.GetByApplication(ValidApplicationId).Returns(_collectionsFromService);
     ApplicationService.GetById(ValidApplicationId)
     .Returns(_applicationFromService);
     _result = ApplicationViewModelGetter.Get(ValidApplicationId);
 }
            public new virtual void SetUp()
            {
                base.SetUp();

                CollectionService.GetByApplication(ApplicationId).Returns(_collectionsFromService);
                LabelCollectionRetriever.Get("ApplicationPage")
                .Returns(new LabelCollection
                {
                    ContentAreas =
                        new List <ContentAreaForDisplay>
                    {
                        new ContentAreaForDisplay
                        {
                            Name    = "UpdateSuccessMessage",
                            Content = SuccessMessage
                        }
                    }
                });
                ApplicationService.Update(ApplicationId, NewName, Active).Returns(_applicationFromService);
                _result = ApplicationViewModelGetter.Update(ApplicationId, NewName, Active);
            }
 public new virtual void SetUp()
 {
     base.SetUp();
     LabelCollectionRetriever.Get("ApplicationPage")
     .Returns(new LabelCollection
     {
         ContentAreas =
             new List <ContentAreaForDisplay>
         {
             new ContentAreaForDisplay
             {
                 Name    = "UpdateFailureMessageApplicationNameExists",
                 Content = LabelForFailure
             }
         }
     });
     ApplicationService.Update(ApplicationId, NewName, Active)
     .Returns(x => { throw new ApplicationNameAlreadyExistsException(); });
     ApplicationService.GetById(ApplicationId).Returns(_applicationFromGetById);
     _result = ApplicationViewModelGetter.Update(ApplicationId, NewName, Active);
 }
예제 #8
0
 public new virtual void SetUp()
 {
     base.SetUp();
     LabelCollectionRetriever.Get("DashboardErrorPage").Returns(_labelsFromRetriever);
     _result = DashboardController.Error();
 }