public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); var salesforceManagerMock = new Mock <ISalesforceManager>(); salesforceManagerMock.Setup(x => x.Query(SalesforceObjectType.Account, It.IsAny <IList <FieldDTO> >(), It.IsAny <string>(), It.IsAny <AuthorizationToken>())) .Returns(Task.FromResult(new StandardTableDataCM { Table = new List <TableRowDTO> { new TableRowDTO { Row = new List <TableCellDTO> { new TableCellDTO { Cell = new KeyValueDTO("Id", "1") } } } } })); salesforceManagerMock.Setup(x => x.PostToChatter(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <AuthorizationToken>())) .Returns(Task.FromResult("feedid")); ObjectFactory.Container.Inject(salesforceManagerMock); ObjectFactory.Container.Inject(salesforceManagerMock.Object); var hubCommunicatorMock = new Mock <IHubCommunicator>(); ObjectFactory.Container.Inject(hubCommunicatorMock); ObjectFactory.Container.Inject(hubCommunicatorMock.Object); HealthMonitor_FixtureData.ConfigureHubToReturnEmptyPayload(); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); //_fixtureData = new FixtureData(ObjectFactory.GetInstance<IUnitOfWork>()); _crate = ObjectFactory.GetInstance <ICrateManager>(); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); TerminalPapertrailMapBootstrapper.ConfigureDependencies(StructureMapBootStrapper.DependencyType.TEST); AutoMapperBootstrapper.ConfigureAutoMapper(); _activity_under_test = New <Write_To_Log_v1>(); }
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 override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); ObjectFactory.Container.ConfigureQuickbooksDependencies(StructureMapBootStrapper.DependencyType.LIVE); _serviceWorker = ObjectFactory.GetInstance <IServiceWorker>(); _journalEntry = new terminalQuickBooks.Services.JournalEntry(_serviceWorker); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); ObjectFactory.Container.Configure(TerminalDocusignStructureMapBootstrapper.LiveConfiguration); SetupForAutomaticPlan(); _curDocuSignPlan = ObjectFactory.GetInstance <DocuSignPlan>(); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); _activity = ObjectFactory.GetInstance <IActivity>(); _crate = ObjectFactory.GetInstance <ICrateManager>(); _eventReceived = false; FixtureData.AddTestActivityTemplate(); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); _coreServer = Fixtures.FixtureData.CreateCoreServer_ActivitiesController(); select_Fr8_Object_v1 = New <Select_Fr8_Object_v1>(); Mock <IRestfulServiceClient> restClientMock = new Mock <IRestfulServiceClient>(MockBehavior.Default); restClientMock.Setup(restClient => restClient.GetAsync <CrateDTO>(It.IsAny <Uri>(), It.IsAny <string>(), It.IsAny <Dictionary <string, string> >())) .Returns(Task.FromResult(FixtureData.TestEmptyCrateDTO())); ObjectFactory.Container.Inject(typeof(IRestfulServiceClient), restClientMock.Object); }
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 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)); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); TerminalSalesforceStructureMapBootstrapper.ConfigureDependencies(TerminalSalesforceStructureMapBootstrapper.DependencyType.TEST); PayloadDTO testPayloadDTO = new PayloadDTO(new Guid()); ObjectFactory.Configure(x => x.For <ICrateManager>().Use(CrateManager)); using (var crateStorage = CrateManager.GetUpdatableStorage(testPayloadDTO)) { crateStorage.Add(Crate.FromContent("Operational Status", new OperationalStateCM())); } Mock <IHubCommunicator> hubCommunicatorMock = new Mock <IHubCommunicator>(MockBehavior.Default); hubCommunicatorMock.Setup(h => h.GetPayload(It.IsAny <Guid>())) .Returns(() => Task.FromResult(testPayloadDTO)); ObjectFactory.Container.Inject(typeof(IHubCommunicator), hubCommunicatorMock.Object); Mock <ISalesforceManager> salesforceIntegrationMock = Mock.Get(ObjectFactory.GetInstance <ISalesforceManager>()); FieldDTO testField = new FieldDTO("Account") { Label = "TestAccount" }; salesforceIntegrationMock.Setup( s => s.GetProperties(SalesforceObjectType.Account, It.IsAny <AuthorizationToken>(), false, null)) .Returns(() => Task.FromResult(new List <FieldDTO> { testField })); salesforceIntegrationMock.Setup( s => s.Query(SalesforceObjectType.Account, It.IsAny <IList <FieldDTO> >(), It.IsAny <string>(), It.IsAny <AuthorizationToken>())) .Returns(() => Task.FromResult(new StandardTableDataCM())); _saveToSFDotCom_v1 = New <Save_To_SalesforceDotCom_v1>(); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); TerminalSalesforceStructureMapBootstrapper.ConfigureDependencies(TerminalSalesforceStructureMapBootstrapper.DependencyType.TEST); PayloadDTO testPayloadDTO = new PayloadDTO(new Guid()); using (var crateStorage = ObjectFactory.GetInstance <ICrateManager>().GetUpdatableStorage(testPayloadDTO)) { crateStorage.Add(Crate.FromContent("Operational Status", new OperationalStateCM())); } Mock <IHubCommunicator> hubCommunicatorMock = new Mock <IHubCommunicator>(MockBehavior.Default); hubCommunicatorMock.Setup(h => h.GetPayload(It.IsAny <Guid>())) .Returns(() => Task.FromResult(testPayloadDTO)); /* hubCommunicatorMock.Setup(h => h.GetDesignTimeFieldsByDirection(It.IsAny<Guid>(), It.IsAny<CrateDirection>(), * It.IsAny<AvailabilityType>())).Returns(() => Task.FromResult(new FieldDescriptionsCM()));*/ ObjectFactory.Container.Inject(typeof(IHubCommunicator), hubCommunicatorMock.Object); Mock <ISalesforceManager> salesforceIntegrationMock = Mock.Get(ObjectFactory.GetInstance <ISalesforceManager>()); salesforceIntegrationMock.Setup(si => si.GetUsersAndGroups(It.IsAny <AuthorizationToken>())).Returns( () => Task.FromResult <IList <KeyValueDTO> >(new List <KeyValueDTO> { new KeyValueDTO("One", "1") })); salesforceIntegrationMock.Setup(si => si.PostToChatter(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <AuthorizationToken>())).Returns(() => Task.FromResult("SomeValue")); postToChatter_v1 = New <Post_To_Chatter_v1>(); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); var restfulServiceClient = new Mock <IRestfulServiceClient>(); restfulServiceClient.Setup(r => r.GetAsync <PayloadDTO>(It.IsAny <Uri>(), It.IsAny <string>(), It.IsAny <Dictionary <string, string> >())) .Returns(Task.FromResult(FixtureData.FakePayloadDTO)); var dropboxServiceMock = new Mock <IDropboxService>(); dropboxServiceMock.Setup(x => x.GetFileList(It.IsAny <AuthorizationToken>())).Returns((AuthorizationToken x) => Task.FromResult(new List <string>())); ObjectFactory.Configure(cfg => { cfg.For <IRestfulServiceClient>().Use(restfulServiceClient.Object); cfg.For <IDropboxService>().Use(dropboxServiceMock.Object); }); _getFileList_v1 = ObjectFactory.GetInstance <Get_File_List_v1>(); //_getFileList_v1.HubCommunicator.Configure("terminalDropbox"); }
public override void SetUp() { base.SetUp(); TerminalBootstrapper.ConfigureTest(); }