public Authorization()
 {
     _terminalService  = ObjectFactory.GetInstance <ITerminal>();
     _crate            = ObjectFactory.GetInstance <ICrateManager>();
     _time             = ObjectFactory.GetInstance <ITime>();
     _activityTemplate = ObjectFactory.GetInstance <IActivityTemplate>();
 }
Example #2
0
 public App_Builder_v1(ICrateManager crateManager, ExcelUtils excelUtils, IPushNotificationService pushNotificationService, PlanService planService)
     : base(crateManager)
 {
     _excelUtils = excelUtils;
     _pushNotificationService = pushNotificationService;
     _planService             = planService;
 }
Example #3
0
        public PlanDirectoryService(IHMACService hmac,
                                    IRestfulServiceClient client,
                                    IPusherNotifier pusherNotifier,
                                    IUnitOfWorkFactory unitOfWorkFactory,
                                    IPlan planService,
                                    IActivityTemplate activityTemplate,
                                    IPlanTemplate planTemplate,
                                    ISearchProvider searchProvider,
                                    IWebservicesPageGenerator webservicesPageGenerator,
                                    IActivity activityService,
                                    ICrateManager crateManager,
                                    IPlanTemplateDetailsGenerator planTemplateDetailsGenerator)
        {
            _hmacService       = hmac;
            _client            = client;
            _pusherNotifier    = pusherNotifier;
            _unitOfWorkFactory = unitOfWorkFactory;
            _planService       = planService;
            _activityTemplate  = activityTemplate;

            _planTemplate                 = planTemplate;
            _searchProvider               = searchProvider;
            _webservicesPageGenerator     = webservicesPageGenerator;
            _activityService              = activityService;
            _crateManager                 = crateManager;
            _planTemplateDetailsGenerator = planTemplateDetailsGenerator;
        }
Example #4
0
 public Generate_DocuSign_Report_v1(ICrateManager crateManager, IDocuSignManager docuSignManager, PlanService planService)
     : base(crateManager)
 {
     _docuSignManager = docuSignManager;
     _planService     = planService;
     InitQueryBuilderFields();
 }
 public ActivityExecutor(IHubCommunicator hubCommunicator, ICrateManager crateManager, IActivityStore activityStore, IContainer container)
 {
     _hubCommunicator = hubCommunicator;
     CrateManager     = crateManager;
     _activityStore   = activityStore;
     _container       = container;
 }
Example #6
0
 public DocuSignPlan(ICrateManager crateManager, IDocuSignManager docuSignManager, IDocuSignConnect docuSignConnect, IHubEventReporter eventReporter)
 {
     _crateManager    = crateManager;
     _docuSignManager = docuSignManager;
     _docuSignConnect = docuSignConnect;
     _eventReporter   = eventReporter;
 }
Example #7
0
 public Event()
 {
     _crateManager = ObjectFactory.GetInstance <ICrateManager>();
     _terminal     = ObjectFactory.GetInstance <ITerminal>();
     _plan         = ObjectFactory.GetInstance <IPlan>();
     _fr8Account   = ObjectFactory.GetInstance <IFr8Account>();
 }
Example #8
0
 public Monitor_Jira_Changes_v1(ICrateManager crateManager, IAtlassianService atlassianService, IPushNotificationService pushNotificationService, IAtlassianEventManager atlassianEventManager)
     : base(crateManager)
 {
     _atlassianService        = atlassianService;
     _pushNotificationService = pushNotificationService;
     _atlassianEventManager   = atlassianEventManager;
 }
 public Track_DocuSign_Recipients_v2(
     ICrateManager crateManager,
     IDocuSignManager docuSignManager,
     IConfigRepository configRepository)
     : base(crateManager, docuSignManager)
 {
     _configRepository = configRepository;
 }
        public override void SetUp()
        {
            base.SetUp();
            TerminalBootstrapper.ConfigureTest();

            //_fixtureData = new FixtureData(ObjectFactory.GetInstance<IUnitOfWork>());
            _crate = ObjectFactory.GetInstance <ICrateManager>();
        }
 public static IUpdatableCrateStorage GetUpdatableStorage(this ICrateManager crateManager, ActivityDTO activity)
 {
     if (activity == null)
     {
         throw new ArgumentNullException(nameof(activity));
     }
     return(crateManager.UpdateStorage(() => activity.CrateStorage));
 }
 public static IUpdatableCrateStorage GetUpdatableStorage(this ICrateManager crateManager, PayloadDTO payload)
 {
     if (payload == null)
     {
         throw new ArgumentNullException(nameof(payload));
     }
     return(crateManager.UpdateStorage(() => payload.CrateStorage));
 }
        public static ICrateStorage GetStorage(this ICrateManager crateManager, string crateStorageRaw)
        {
            if (string.IsNullOrWhiteSpace(crateStorageRaw))
            {
                return(new CrateStorage());
            }

            return(crateManager.FromDto(StringToCrateStorageDTOConverter.Convert(crateStorageRaw)));
        }
Example #14
0
 public Activity(ICrateManager crateManager, IAuthorization authorizationToken, ISecurityServices security, IActivityTemplate activityTemplate, IPlanNode planNode, IUpstreamDataExtractionService upstreamDataExtractionService)
 {
     _crateManager                  = crateManager;
     _authorizationToken            = authorizationToken;
     _security                      = security;
     _activityTemplate              = activityTemplate;
     _planNode                      = planNode;
     _upstreamDataExtractionService = upstreamDataExtractionService;
 }
Example #15
0
 public Create_Message_v1(ICrateManager crateManager, IBasecampApiClient basecampApiClient) : base(crateManager)
 {
     if (basecampApiClient == null)
     {
         throw new ArgumentNullException(nameof(basecampApiClient));
     }
     _basecampApiClient          = basecampApiClient;
     DisableValidationOnFollowup = true;
 }
        public static ICrateStorage GetStorage(this ICrateManager crateManager, CrateStorageDTO crateStorageDTO)
        {
            if (crateStorageDTO == null)
            {
                return(new CrateStorage());
            }

            return(crateManager.FromDto(crateStorageDTO));
        }
 public override void SetUp()
 {
     base.SetUp();
     ObjectFactory.Configure(x => x.AddRegistry <TerminalSendGridStructureMapBootstrapper.LiveMode>());
     ObjectFactory.Configure(cfg => cfg.For <ITransport>().Use(c => TransportFactory.CreateWeb(c.GetInstance <IConfigRepository>())));
     ObjectFactory.Configure(cfg => cfg.For <IEmailPackager>().Use(c => new SendGridPackager(c.GetInstance <IConfigRepository>())));
     TerminalBootstrapper.ConfigureTest();
     _crate          = ObjectFactory.GetInstance <ICrateManager>();
     activityPayload = GetActivityResult().Result;
 }
 public Monitor_Google_Spreadsheet_Changes_v1(
     ICrateManager crateManager,
     IGoogleIntegration googleIntegration,
     IGoogleSheet googleSheet,
     IGoogleGDrivePolling googleGDrivePolling)
     : base(crateManager, googleIntegration)
 {
     _googleSheet         = googleSheet;
     _googleGDrivePolling = googleGDrivePolling;
 }
Example #19
0
        protected DocuSignActivity(ICrateManager crateManager, IDocuSignManager docuSignManager)
            : base(crateManager)
        {
            if (docuSignManager == null)
            {
                throw new ArgumentNullException(nameof(docuSignManager));
            }

            DocuSignManager = docuSignManager;
        }
Example #20
0
        public override void SetUp()
        {
            base.SetUp();
            TerminalBootstrapper.ConfigureTest();

            _activity      = ObjectFactory.GetInstance <IActivity>();
            _crate         = ObjectFactory.GetInstance <ICrateManager>();
            _eventReceived = false;

            FixtureData.AddTestActivityTemplate();
        }
Example #21
0
 public Plan(IContainerService containerService, Fr8Account dockyardAccount, IActivity activity,
             ICrateManager crate, ISecurityServices security, IJobDispatcher dispatcher, IPusherNotifier pusher)
 {
     _containerService = containerService;
     _dockyardAccount  = dockyardAccount;
     _activity         = activity;
     _crate            = crate;
     _security         = security;
     _dispatcher       = dispatcher;
     _pusherNotifier   = pusher;
 }
Example #22
0
        //constructor method as it is run at the test start
        public override void SetUp()
        {
            base.SetUp();

            InitializeContainer();

            CrateManager    = ObjectFactory.GetInstance <ICrateManager>();
            ActivityService = new ActivityServiceMock(ObjectFactory.GetInstance <Hub.Interfaces.IActivity>());
            ObjectFactory.Container.Inject(typeof(Hub.Interfaces.IActivity), ActivityService);
            ContainerService = ObjectFactory.GetInstance <Hub.Interfaces.IContainerService>();
            Plan             = ObjectFactory.GetInstance <Hub.Interfaces.IPlan>();

            FixtureData.AddTestActivityTemplate();
        }
Example #23
0
        public virtual void SetUp()
        {
            ObjectFactory.Initialize();
            StructureMapBootStrapper.ConfigureDependencies(StructureMapBootStrapper.DependencyType.TEST);
            MockedDBContext.WipeMockedDatabase();
            ConfigureAutoMapper();
            DataAutoMapperBootStrapper.ConfigureAutoMapper();
            CrateManager = ObjectFactory.Container.GetInstance <ICrateManager>();
            ObjectFactory.Configure(x => x.AddRegistry <Fr8.Infrastructure.StructureMap.StructureMapBootStrapper.TestMode>());


            using (var uow = ObjectFactory.GetInstance <IUnitOfWork>()) //Get the seeding done first
                uow.SaveChanges();
        }
Example #24
0
 public ContainerService(IActivity activity,
                         ICrateManager crateManager,
                         IUtilizationMonitoringService utilizationMonitoringService,
                         IActivityExecutionRateLimitingService activityRateLimiter,
                         IPusherNotifier pusher,
                         IUnitOfWorkFactory uowFactory)
 {
     _utilizationMonitoringService = utilizationMonitoringService;
     _activityRateLimiter          = activityRateLimiter;
     _pusherNotifier = pusher;
     _uowFactory     = uowFactory;
     _activity       = activity;
     _crate          = crateManager;
 }
Example #25
0
 public PlansController(IPlan plan,
                        ISecurityServices securityServices,
                        ICrateManager crateManager,
                        IPusherNotifier pusherNotifier,
                        IActivityTemplate activityTemplate,
                        IActivity activity,
                        IPlanDirectoryService planDirectoryService)
 {
     _plan                 = plan;
     _security             = securityServices;
     _crate                = crateManager;
     _pusherNotifier       = pusherNotifier;
     _activityTemplate     = activityTemplate;
     _activity             = activity;
     _planDirectoryService = planDirectoryService;
 }
Example #26
0
        public static bool IsStorageEmpty(this ICrateManager crateManager, ActivityDO activity)
        {
            if (string.IsNullOrWhiteSpace(activity.CrateStorage))
            {
                return(true);
            }

            var proxy = JsonConvert.DeserializeObject <CrateStorageDTO>(activity.CrateStorage);

            if (proxy.Crates == null)
            {
                return(true);
            }

            return(proxy.Crates.Length == 0);
        }
            /**********************************************************************************/
            // Functions
            /**********************************************************************************/

            public ExecutionSession(IUnitOfWork uow,
                                    OperationalStateCM.ActivityCallStack callStack,
                                    ContainerDO container,
                                    IActivity activity,
                                    ICrateManager crateManager,
                                    IUtilizationMonitoringService utilizationMonitoringService,
                                    IActivityExecutionRateLimitingService activityRateLimiter)
            {
                _uow       = uow;
                _callStack = callStack;
                _container = container;

                _activity = activity;
                _crate    = crateManager;
                _utilizationMonitoringService = utilizationMonitoringService;
                _activityRateLimiter          = activityRateLimiter;
            }
        public override void SetUp()
        {
            base.SetUp();

            TerminalBootstrapper.ConfigureTest();

            _crateManager = ObjectFactory.GetInstance <ICrateManager>();

            string samplePayload = _crateManager.CrateStorageAsStr(new CrateStorage(Crate.FromContent("ExplicitData_PayloadCrate", new OperationalStateCM())));

            ObjectFactory.Configure(x =>
            {
                x.For <IRestfulServiceClient>().Use <RestfulServiceClient>().SelectConstructor(() => new RestfulServiceClient());
                x.For <IHubCommunicator>().Use(new ExplicitDataHubCommunicator(samplePayload, _crateManager)).Singleton();
            });

            FixtureData.AddTestActivityTemplate();
        }
        public BaseTerminalEvent()
        {
            //Missing CoreWebServerUrl most likely means that terminal is running in an integration test environment.
            //Disable event distribution in such case since we don't need it (nor do we have a Hub instance
            //to send events too).
            eventWebServerUrl = CloudConfigurationManager.GetSetting("CoreWebServerUrl");
            if (string.IsNullOrEmpty(eventWebServerUrl))
            {
                eventsDisabled = true;
            }
            else
            {
                eventWebServerUrl += "api/v1/events";
            }

            _eventReportCrateFactory = new EventReportCrateFactory();
            _loggingDataCrateFactory = new LoggingDataCrateFactory();
            _crateManager            = ObjectFactory.GetInstance <ICrateManager>();
        }
        public override void SetUp()
        {
            base.SetUp();
            const StructureMapBootStrapper.DependencyType dependencyType = StructureMapBootStrapper.DependencyType.TEST;

            DataAutoMapperBootStrapper.ConfigureAutoMapper();
            StructureMapBootStrapper.ConfigureDependencies(dependencyType).ConfigureTwilioDependencies(dependencyType);
            TerminalBootstrapper.ConfigureTest();

            _crate = ObjectFactory.GetInstance <ICrateManager>();

            var twilioService = new Mock <ITwilioService>();

            twilioService
            .Setup(c => c.GetRegisteredSenderNumbers())
            .Returns(new List <string> {
                ConfigurationManager.AppSettings["TestPhoneNumber"]
            });
            ObjectFactory.Configure(cfg => cfg.For <ITwilioService>().Use(twilioService.Object));

            var activityDO    = FixtureData.ConfigureTwilioActivity();
            var actionService = new Mock <IActivity>();

            ObjectFactory.Configure(cfg => cfg.For <IActivity>().Use(actionService.Object));

            /*
             * var activity = FixtureData.ConfigureTwilioActivity();
             *
             * var baseTerminalAction = new Mock<ExplicitTerminalActivity>();
             * baseTerminalAction
             *  .Setup(c => c.GetDesignTimeFields(CrateDirection.Upstream, AvailabilityType.NotSet))
             *  .Returns(Task.FromResult(FixtureData.TestFields()));
             * ObjectFactory.Configure(cfg => cfg.For<ExplicitTerminalActivity>().Use(baseTerminalAction.Object));
             */
            var hubCommunicator = new Mock <IHubCommunicator>();

            /* hubCommunicator.Setup(hc => hc.GetDesignTimeFieldsByDirection(
             *                                   It.IsAny<Guid>(),
             *                                   CrateDirection.Upstream,
             *                                   It.IsAny<AvailabilityType>())).Returns(Task.FromResult(FixtureData.TestFields()));*/
            ObjectFactory.Configure(cfg => cfg.For <IHubCommunicator>().Use(hubCommunicator.Object));
        }