public IDatastore LoadDataFromSource(DesignerItemBase sourceItem, IDatastore dataStore, ReportProgressMethod reportProgressMethod)
        {
            IModule     sourceObject     = objectResolver.GetModule(sourceItem.ID, sourceItem.ModuleDescription.ModuleType);
            IConnection connectionObject = objectResolver.GetConnection(sourceItem.ID);

            if (connectionObject == null)
            {
                if (runLog != null)
                {
                    string label = String.IsNullOrEmpty(sourceItem.ItemLabel) ? "-- No Label --" : sourceItem.ItemLabel;
                    throw new Exception("No connection was selected for the source '" + label + "'.");
                }
                dataStore = null;
            }

            ItemLog itemLog = ItemLog.CreateNew(sourceItem.ID, sourceItem.ItemLabel, sourceItem.ModuleDescription.ModuleType.Name, null);

            if (runLog != null)
            {
                var databaseInterface = SqliteWrapper.GetSqliteWrapper(runLog.RunLogPath, sourceItem.ID, sourceItem.ItemLabel);
                itemLog.DatabasePath = runLog.RunLogPath + "\\" + databaseInterface.GetDatabaseName();
                parentItemLog.SubFlowLogs.Add(itemLog);
            }

            ((IDataSource)sourceObject).LoadData(connectionObject, dataStore, reportProgressMethod);

            itemLog.EndTime = DateTime.Now;

            return(dataStore);
        }
Example #2
0
        public NcaabbGame(IDataAccessNcaabb dataAccessNcaabb, IRadarNcaabb radarNcaabb, IAnalyticaNcaabb analyticaNcaabb, IDatastore datastore, IDistributorNcaabb distributorNcaabb, IPubSubUtil pubSubUtil, IPusherUtil pusherUtil)
        {
            PeriodList = new List <string> {
                "CG", "H1", "H2", "Q1", "Q2", "Q3", "Q4"
            };
            InitializePeriodScoring(PeriodList);
            GameTimeSeconds = 2400;
            ModelData[NcaabbModelDataKeys.InMlf]    = new Dictionary <string, double>();
            ModelData[NcaabbModelDataKeys.InLMlf]   = new Dictionary <string, double>();
            ModelData[NcaabbModelDataKeys.Evs]      = new Dictionary <string, double>();
            ModelData[NcaabbModelDataKeys.InTsf]    = new Dictionary <string, double>();
            ModelData[NcaabbModelDataKeys.Egt]      = new Dictionary <string, double>();
            ModelData[NcaabbModelDataKeys.InLsF]    = new Dictionary <string, double>();
            ModelData[NcaabbModelDataKeys.Settings] = new Dictionary <string, double>();

            NcaabbGameState = new NcaabbGameState();

            _dataAccessNcaabb  = dataAccessNcaabb;
            _analyticaNcaabb   = analyticaNcaabb;
            _datastore         = datastore;
            _distributorNcaabb = distributorNcaabb;
            _radarNcaabb       = radarNcaabb;
            _pubSubUtil        = pubSubUtil;
            _pusherUtil        = pusherUtil;
            _marketList        = dataAccessNcaabb.GetMarketsDescriptions();
        }
Example #3
0
 public DeletionMappingJoin(DeleteInDynamicsCrmConfiguration configuration, EntityMetadata entityMetadata, IDatastore dataObject)
 {
     InitializeComponent();
     this.entityMetadata = entityMetadata;
     this.dataObject     = dataObject;
     InitializeMappingControl(configuration.DeleteMapping);
 }
Example #4
0
 public DbTargetWriter(IDatabaseTargetProvider databaseTargetProvider, IDatastore datastore, DataStoreConverter dataStoreConverter, DbTargetCommonConfiguration configuration)
 {
     this.databaseTargetProvider = databaseTargetProvider;
     this.datastore          = datastore;
     this.dataStoreConverter = dataStoreConverter;
     this.configuration      = configuration;
 }
Example #5
0
        public void WhenDeletingAPassword_ItShouldBeDeleted()
        {
            // Given
            IDatastore originalDatastore   = null;
            AccountDto twitterAccount      = null;
            FieldDto   originalPasswordDto = null;
            FieldDto   changedPasswordDto  = FakeData.FakeDataGenerator.GetFacebookPassword();

            // When
            TestWithPrepopulatedDatastore(dataStore =>
            {
                originalDatastore = dataStore;
                twitterAccount    =
                    dataStore.GetAccountDtos().First(account =>
                                                     account.ProviderKey == FakeData.FakeDataGenerator.TwitterProviderKey);
                originalPasswordDto = twitterAccount.Fields.Single(field => field.FieldTypeKey == "pin");
                twitterAccount.Fields.Remove(originalPasswordDto);
                twitterAccount.Fields.Add(changedPasswordDto);
                originalDatastore.SaveAccountDto(twitterAccount);
            });

            // Then
            originalDatastore.GetAccountDto(twitterAccount.Id).Fields.Should().NotContain(originalPasswordDto);
            originalDatastore.GetAccountDto(twitterAccount.Id).Fields.Should().Contain(changedPasswordDto);
        }
        private void JoinDatastoreRecords(IDatastore resultDatastore)
        {
            IDatastoreColumnHashBuilder smallDataStoreHashBuilder = new DatastoreColumnHashBuilder(smallDatastore, smallDatastoreKeys);

            smallDataStoreHashBuilder.BuildHashes();

            int[] largeDatastoreColumnIndexes = GetColumnIndexes();
            for (int rowIndex = 0; rowIndex < largeDatastore.Count; rowIndex++)
            {
                RowHash rowHash            = smallDataStoreHashBuilder.GetRowHash(largeDatastore[rowIndex], largeDatastoreColumnIndexes);
                var     smallDatastoreRows = smallDataStoreHashBuilder.GetRowsByHash(rowHash.Value);

                List <object[]> joinedRows = null;
                switch (this.Configuration.JoinType)
                {
                case JoinRecordsJoinType.LeftJoin:
                    joinedRows = ExecuteLeftJoin(rowIndex, rowHash, smallDatastoreRows);
                    break;

                case JoinRecordsJoinType.InnerJoin:
                    joinedRows = ExecuteInnerJoin(rowIndex, rowHash, smallDatastoreRows);
                    break;
                }

                AddJoinedRowsToDatastore(resultDatastore, joinedRows);
            }
        }
Example #7
0
        public void GeneralLoadTestDynamicsCRM()
        {
            var organizationService = connection.GetConnection() as IOrganizationService;

            Guid account1 = CreateAccount1(organizationService);

            string contactName1 = Guid.NewGuid().ToString();
            Guid   contact1     = CreateContact1(organizationService, contactName1, account1);

            LoadFromDynamicsCrmConfiguration configuration = new LoadFromDynamicsCrmConfiguration();

            configuration.QueryType = DynamicsCrmQueryType.ExecuteFetchXml;
            configuration.FetchXml  = GetTestFetchXml(contactName1);

            IDataSource loadFromDynamicsCrm = new LoadFromDynamicsCrm()
            {
                Configuration = configuration
            };

            IDatastore dataObject = DataStoreFactory.GetDatastore();

            loadFromDynamicsCrm.LoadData(connection, dataObject, ReportProgressMethod);

            var firstObject = dataObject[0];

            Assert.AreEqual <string>(contactName1, firstObject[dataObject.Metadata["firstname"].ColumnIndex].ToString());

            organizationService.Delete("contact", contact1);
            organizationService.Delete("account", account1);
        }
Example #8
0
        public void GeneralLoadTestCSV()
        {
            ConnectToTextFileConfiguration configuration = new ConnectToTextFileConfiguration();

            configuration.FilePath = @"TestData\LoadFromCSV\TestCSV.csv";

            IConnection csvConnection = new ConnectToTextFile()
            {
                Configuration = configuration
            };

            LoadFromCSV loadFromCSV = new LoadFromCSV();

            loadFromCSV.SetConfiguration(new LoadFromCSVConfiguration());

            IDatastore dataObject = DataStoreFactory.GetDatastore();

            loadFromCSV.LoadData(csvConnection, dataObject, ReportProgressMethod);

            var firstObject = dataObject[0];

            Assert.AreEqual <string>(firstObject[0].ToString(), "1");
            Assert.AreEqual <string>(firstObject[6].ToString(), "9/19/2015");

            var lastObject = dataObject[999];

            Assert.AreEqual <string>(lastObject[0].ToString(), "1000");
            Assert.AreEqual <string>(lastObject[6].ToString(), "4/5/2015");
        }
Example #9
0
        public NcaafbGame(IDataAccessNcaafb dataAccessNcaafb, IRadarNcaafb radarNcaafb, IAnalyticaNcaafb analyticaNcaafb, IDatastore datastore, IDistributorNcaafb distributorNcaafb, IPubSubUtil pubSubUtil, IPusherUtil pusherUtil)
        {
            Logger.Info("Starting");
            string isSimulationString = ConfigurationManager.AppSettings["isSimulation"];

            IsSimulation = ToBoolean(isSimulationString);

            PeriodList = new List <string> {
                "CG", "H1", "H2", "Q1", "Q2", "Q3", "Q4"
            };
            InitializePeriodScoring(PeriodList);

            ModelData[NcaafbModelDataKeys.InMlf]  = new Dictionary <string, double>();         // PRE MATCH MARKET LINES
            ModelData[NcaafbModelDataKeys.InLMlf] = new Dictionary <string, double>();         // IN RUNNING MARKET LINES
            ModelData[NcaafbModelDataKeys.Egt]    = new Dictionary <string, double>();         // EVENT GAME TIME
            ModelData[NcaafbModelDataKeys.Evs]    = new Dictionary <string, double>();         // EVENT STATE
            ModelData[NcaafbModelDataKeys.InTsf]  = new Dictionary <string, double>();         // TEAM STATS
            ModelData[NcaafbModelDataKeys.InSc]   = new Dictionary <string, double>();         // SCORING CURVE
            ModelData[NcaafbModelDataKeys.Xs]     = new Dictionary <string, double>();         // EXTRA STATS

            NcaafbGameState = new NcaafbGameState();

            _dataAccessNcaafb  = dataAccessNcaafb;
            _analyticaNcaafb   = analyticaNcaafb;
            _datastore         = datastore;
            _distributorNcaafb = distributorNcaafb;
            _radarNcaafb       = radarNcaafb;
            _pubSubUtil        = pubSubUtil;
            _pusherUtil        = pusherUtil;
        }
Example #10
0
 public MemberJoinMapping(WriteToDynamicsCrmMarketingListsConfiguration configuration, List <EntityMetadata> entitiesMetadata, IDatastore dataObject)
 {
     InitializeComponent();
     this.configuration    = configuration;
     this.entitiesMetadata = entitiesMetadata;
     this.dataObject       = dataObject;
 }
Example #11
0
 public TimeCacheDatastore(IDatastore <T> ds, TimeSpan ttl)
 {
     _ds   = ds;
     _ttl  = ttl;
     _ttls = new Dictionary <DatastoreKey, DateTime>();
     _lock = new SemaphoreSlim(1, 1);
 }
Example #12
0
        public void Test_AccountDeletion()
        {
            var organizationService = connection.GetConnection() as IOrganizationService;

            // Create dummy account, which shall be deleted
            string accountName1 = Guid.NewGuid().ToString();
            Entity account      = new Entity("account");

            account.Attributes.Add("name", accountName1);
            Guid account1 = organizationService.Create(account);

            DeleteInDynamicsCrmConfiguration deleteInCrmConfig = new DeleteInDynamicsCrmConfiguration();

            deleteInCrmConfig.EntityName        = "account";
            deleteInCrmConfig.MultipleFoundMode = DeleteInCrmMultipleFoundMode.DeleteAll;
            deleteInCrmConfig.DeleteMapping.Add(new DataMapping()
            {
                Source = "CompanyName", Target = "name"
            });

            IDatastore dataObject = DataStoreFactory.GetDatastore();

            dataObject.AddColumn(new ColumnMetadata("CompanyName"));

            dataObject.AddData(new object[] { accountName1 });

            IModule module = Activator.CreateInstance(typeof(DeleteInDynamicsCrm)) as IModule;

            module.SetConfiguration(deleteInCrmConfig);

            ((IDataTarget)module).WriteData(connection, new DummyDatabaseInterface(), dataObject, ReportProgressMethod);
        }
Example #13
0
        public void WriteData(IConnection connection, IDatabaseInterface databaseInterface, IDatastore dataObject, ReportProgressMethod reportProgress)
        {
            this.reportProgress = reportProgress;

            reportProgress(new SimpleProgressReport("Connection to crm"));
            CrmConnection crmConnection = (CrmConnection)connection.GetConnection();

            this.service    = new OrganizationService(crmConnection);
            this.dataObject = dataObject;

            reportProgress(new SimpleProgressReport("Load required metadata from crm"));
            entity1Metadata      = Crm2013Wrapper.Crm2013Wrapper.GetEntityMetadata(this.service, this.Configuration.Entity1Name);
            entity2Metadata      = Crm2013Wrapper.Crm2013Wrapper.GetEntityMetadata(this.service, this.Configuration.Entity2Name.Split(';')[0]);
            relationshipMetadata = Crm2013Wrapper.Crm2013Wrapper.GetRelationshipMetadata(this.service, this.Configuration.Entity2Name.Split(';')[1]) as ManyToManyRelationshipMetadata;

            reportProgress(new SimpleProgressReport("Cache keys of existing " + entity1Metadata.LogicalName + "-records"));
            var entity1Resolver = new JoinResolver(this.service, entity1Metadata, this.Configuration.Entity1Mapping);

            this.existingEntities1 = entity1Resolver.BuildMassResolverIndex();

            reportProgress(new SimpleProgressReport("Cache keys of existing " + entity2Metadata.LogicalName + "-records"));
            var entity2Resolver = new JoinResolver(this.service, entity2Metadata, this.Configuration.Entity2Mapping);

            this.existingEntities2 = entity2Resolver.BuildMassResolverIndex();

            RelateEntities();
        }
Example #14
0
        public static void Main(string[] args)
        {
                        #if !DEBUG
            Trace.Listeners.Add(new SyslogTrace.SyslogTraceListener("CSGO-A: WSS"));
                        #else
            Trace.Listeners.Add(new ConsoleTraceListener(true));
                        #endif

            if (!Directory.Exists("demo"))
            {
                Directory.CreateDirectory("demo");
            }

            Database = new MongoDatastore("DemoInfo");

            var contexts = new List <UploadWorkerContext>(Slots);
            for (int i = 0; i < Slots; i++)
            {
                contexts.Add(new UploadWorkerContext {
                });
            }
            q = new UploadQueue(contexts);

            var server = new WebSocketServer(
                new IPEndPoint(IPAddress.Any, 5501))
            {
                ClientHandler = HandleClient
            };
            var serverTask = server.RunAsync();

            System.Threading.Thread.Sleep(int.MaxValue);

            server.RequestShutdown();
            serverTask.Wait();
        }
Example #15
0
        public MainPageViewModel(INavigationService navigationService)
        {
            Tags               = new ObservableCollection <TagViewModel>();
            Accounts           = new ObservableCollection <AccountViewModel>();
            _navigationService = navigationService;

            var selectedDatastore = IsolatedStorageHelper.GetApplicationSetting("dataStore") as IDatastore;

            if (selectedDatastore == null)
            {
                var app = Application.Current as App;
                if (app != null)
                {
                    _dataStore = app.Datastores.GetSelectedDatastore();
                }
                else
                {
                    var init = new Init();
                    _dataStore = init.GetDatastores().GetSelectedDatastore();
                }
                var fakeData = new FakeDataGenerator();
                fakeData.GenerateFakeData(_dataStore);
            }
            else
            {
                _dataStore = selectedDatastore;
            }

            _accounts = new Accounts(_dataStore);

            UpdateUi();

            // _dataStore.OnSaved += RepositoryChanged;
        }
        public void Webrequest_NoProxy_NoCertificate_Method_Get()
        {
            ConnectToUrlConfiguration configuration = new ConnectToUrlConfiguration();

            configuration.UseProxySettings      = false;
            configuration.SendClientCertificate = false;

            IConnection connectToUrlConnection = new ConnectToUrl()
            {
                Configuration = configuration
            };

            LoadFromWebRequestConfiguration loadFromWebRequestConfiguration = new LoadFromWebRequestConfiguration();

            loadFromWebRequestConfiguration.Url    = "http://jsonplaceholder.typicode.com/todos/3";
            loadFromWebRequestConfiguration.Method = "GET";

            IDataSource loadFromWebRequest = new LoadFromWebRequest()
            {
                Configuration = loadFromWebRequestConfiguration
            };

            IDatastore dataObject = DataStoreFactory.GetDatastore();

            loadFromWebRequest.LoadData(connectToUrlConnection, dataObject, Test_Helpers.ReportProgressMethod);
        }
 private void AddJoinedRowsToDatastore(IDatastore resultDatastore, List <object[]> joinedRows)
 {
     foreach (var joinedRow in joinedRows)
     {
         resultDatastore.AddData(joinedRow);
     }
 }
        public void WriteData(IConnection connection, IDatabaseInterface databaseInterface, IDatastore dataObject, ReportProgressMethod reportProgress)
        {
            this.reportProgress = reportProgress;

            reportProgress(new SimpleProgressReport("Connection to crm"));
            this.service    = connection.GetConnection() as IOrganizationService;
            this.dataObject = dataObject;

            reportProgress(new SimpleProgressReport("Load marketinglist metadata"));
            this.listEntityMetaData = Crm2013Wrapper.Crm2013Wrapper.GetEntityMetadata(service, "list");

            reportProgress(new SimpleProgressReport("Resolve existing marketinglists"));
            JoinResolver listResolver = new JoinResolver(this.service, listEntityMetaData, this.Configuration.ListMapping);

            this.existingLists = listResolver.BuildMassResolverIndex();

            reportProgress(new SimpleProgressReport("Load members metadata"));
            EntityMetadata memberEntityMetaData = Crm2013Wrapper.Crm2013Wrapper.GetEntityMetadata(service, this.Configuration.ListMemberType.ToString().ToLower());

            reportProgress(new SimpleProgressReport("Resolve listmembers"));
            JoinResolver memberResolver = new JoinResolver(this.service, memberEntityMetaData, this.Configuration.ListMemberMapping);

            this.existingMembers = memberResolver.BuildMassResolverIndex();

            switch (this.Configuration.JoinList)
            {
            case MarketinglistJoinType.Manual:
                DoManualMarketingList();
                break;

            case MarketinglistJoinType.Join:
                DoJoinMarketingLists();
                break;
            }
        }
 public ConfigurationWindow(WriteToDynamicsCrmN2NConfiguration configuration, IDatastore dataObject)
 {
     InitializeComponent();
     this.dataObject             = dataObject;
     this.configuration          = configuration;
     ddEntity1.SelectionChanged += ddEntity1_SelectionChanged;
 }
Example #20
0
        public void LoadData(IConnection connection, IDatastore datastore, ReportProgressMethod reportProgress)
        {
            ExcelConnectionObject excelConnection = (ExcelConnectionObject)connection.GetConnection();
            ExcelWorksheet        worksheet       = excelConnection.Worksheet;

            for (int rowNumber = 1; rowNumber <= worksheet.Dimension.End.Row; rowNumber++)
            {
                // If first row, the build MetaData
                if (rowNumber == 1)
                {
                    for (int columnNumber = 1; columnNumber <= worksheet.Dimension.End.Column; columnNumber++)
                    {
                        string columnName = worksheet.GetValue(rowNumber, columnNumber).ToString();
                        datastore.AddColumn(new ColumnMetadata(columnName));
                    }
                    continue;
                }

                // All other rows go to the data
                object [] rowData = new object [worksheet.Dimension.End.Column];
                for (int columnNumber = 1; columnNumber <= worksheet.Dimension.End.Column; columnNumber++)
                {
                    rowData[columnNumber - 1] = worksheet.GetValue(rowNumber, columnNumber);
                }
                datastore.AddData(rowData);

                if (StatusHelper.MustShowProgress(rowNumber - 1, worksheet.Dimension.End.Row) == true)
                {
                    reportProgress(new SimpleProgressReport("Loaded " + rowNumber + " of " + worksheet.Dimension.End.Row + " records"));
                }
            }
        }
Example #21
0
        public MainPageViewModel(INavigationService navigationService)
        {
            Tags = new ObservableCollection<TagViewModel>();
            Accounts = new ObservableCollection<AccountViewModel>();
            _navigationService = navigationService;

            var selectedDatastore = IsolatedStorageHelper.GetApplicationSetting("dataStore") as IDatastore;
            if (selectedDatastore == null) {
                var app = Application.Current as App;
                if (app != null) {
                    _dataStore = app.Datastores.GetSelectedDatastore();
                } else {
                    var init = new Init();
                    _dataStore = init.GetDatastores().GetSelectedDatastore();
                }
                var fakeData = new FakeDataGenerator();
                fakeData.GenerateFakeData(_dataStore);
            } else {
                _dataStore = selectedDatastore;
            }

            _accounts = new Accounts(_dataStore);

            UpdateUi();

            // _dataStore.OnSaved += RepositoryChanged;
        }
 public ListMappingJoin(WriteToDynamicsCrmMarketingListsConfiguration configuration, EntityMetadata entityMetadata, IDatastore dataObject)
 {
     InitializeComponent();
     this.entityMetadata = entityMetadata;
     this.dataObject     = dataObject;
     InitializeMappingControl(configuration.ListMapping);
 }
Example #23
0
        public NflGame(IDataAccessNfl dataAccessNfl, IRadarNfl radarNfl, IAnalyticaNfl analyticaNfl, IDatastore datastore, IDistributorNfl distributorNfl, IPubSubUtil pubSubUtil, IPusherUtil pusherUtil)
        {
            string isSimulationString = ConfigurationManager.AppSettings["isSimulation"];

            IsSimulation = ToBoolean(isSimulationString);

            PeriodList = new List <string> {
                "CG", "H1", "H2", "Q1", "Q2", "Q3", "Q4"
            };
            InitializePeriodScoring(PeriodList);

            ModelData[NflModelDataKeys.InMlf]    = new Dictionary <string, double>();       // PRE MATCH MARKET LINES
            ModelData[NflModelDataKeys.InLMlf]   = new Dictionary <string, double>();       // IN RUNNING MARKET LINES
            ModelData[NflModelDataKeys.Egt]      = new Dictionary <string, double>();       // EVENT GAME TIME
            ModelData[NflModelDataKeys.Evs]      = new Dictionary <string, double>();       // EVENT STATE
            ModelData[NflModelDataKeys.InTsf]    = new Dictionary <string, double>();       // TEAM STATS
            ModelData[NflModelDataKeys.InSc]     = new Dictionary <string, double>();       // SCORING CURVE
            ModelData[NflModelDataKeys.Xs]       = new Dictionary <string, double>();       // EXTRA STATS
            ModelData[NflModelDataKeys.Settings] = new Dictionary <string, double>();       //model settings
            ModelData[NflModelDataKeys.Adjust]   = new Dictionary <string, double>();       //market Adjustment settings

            NflGameState = new NflGameState();

            _dataAccessNfl  = dataAccessNfl;
            _analyticaNfl   = analyticaNfl;
            _datastore      = datastore;
            _distributorNfl = distributorNfl;
            _radarNfl       = radarNfl;
            _pubSubUtil     = pubSubUtil;
            _pusherUtil     = pusherUtil;
            _marketList     = dataAccessNfl.GetMarketsDescriptions();
        }
Example #24
0
        public MlbGame(IDataAccessMlb dataAccessMlb, IRadarMlb radarMlb, IAnalyticaMlb analyticaMlb, IDatastore datastore, IDistributorMlb distributorMlb, IPubSubUtil pubSubUtil, IPusherUtil pusherUtil)
        {
            string isSimulationString = ConfigurationManager.AppSettings["isSimulation"];

            IsSimulation = ToBoolean(isSimulationString);

            PeriodList = new List <string> {
                "F3", "F5", "F7", "CG", "I1", "I2", "I3", "I4", "I5", "I6", "I7", "I8", "I9"
            };
            InitializePeriodScoring(PeriodList);

            ModelData[MlbModelDataKeys.InMlf]  = new Dictionary <string, double>();
            ModelData[MlbModelDataKeys.InLMlf] = new Dictionary <string, double>();
            ModelData[MlbModelDataKeys.Evs]    = new Dictionary <string, double>();
            ModelData[MlbModelDataKeys.InTsf]  = new Dictionary <string, double>();
            ModelData[MlbModelDataKeys.Egt]    = new Dictionary <string, double>();

            MlbGameState = new MlbGameState();

            _dataAccessMlb  = dataAccessMlb;
            _radarMlb       = radarMlb;
            _analyticaMlb   = analyticaMlb;
            _datastore      = datastore;
            _distributorMlb = distributorMlb;
            _pubSubUtil     = pubSubUtil;
            _pusherUtil     = pusherUtil;
        }
Example #25
0
        public void AssertSimpleInnerJoin(IDatastore resultDatastore)
        {
            List <JoinRecordsRowSimpleTest> joinRecordsRows = ConvertToJoinRecordsRows(resultDatastore);

            Assert.IsTrue(joinRecordsRows.Count(row => row.CompanyId == 1 && row.PersonId == 2) == 1);
            Assert.IsTrue(joinRecordsRows.Count(row => row.CompanyId == 2 && row.PersonId == 3) == 1);
        }
Example #26
0
 public GraphQlController(ISchema schema, IDocumentExecuter documentExecuter, IDataLoaderContextAccessor accessor, IDatastore dataStore)
 {
     _schema           = schema;
     _documentExecuter = documentExecuter;
     _accessor         = accessor;
     _dataStore        = dataStore;
 }
 public DistributorWnba(IDataAccessWnba dataAccessWnba, IDatastore datastore, IPusherUtil pusherUtil)
 {
     _datastore  = datastore;
     PusherUtil  = pusherUtil;
     _marketList = dataAccessWnba.GetMarkets();
     InitializeLists();
 }
Example #28
0
        public void WhenAddingMultipeAccounts_TheyShouldBeAdded()
        {
            // Given
            var facebookAccount  = FakeData.FakeDataGenerator.GetFacebookAccount();
            var facebookPassword = FakeData.FakeDataGenerator.GetFacebookPassword();

            facebookAccount.Fields.Add(facebookPassword);

            var twitterAccount  = FakeData.FakeDataGenerator.GetTwitterAccount();
            var twitterPassword = FakeData.FakeDataGenerator.GetTwitterPassword();

            facebookAccount.Fields.Add(twitterPassword);

            IDatastore originalDatastore = null;

            // When
            TestWithEmptyDatastore(dataStore =>
            {
                dataStore.SaveAccountDto(facebookAccount);
                dataStore.SaveAccountDto(twitterAccount);
                originalDatastore = dataStore;
            });

            // Then
            originalDatastore.GetAccountDtos().Should().HaveCount(2);
            TestAccountAndPassword(originalDatastore, facebookAccount);
            TestAccountAndPassword(originalDatastore, twitterAccount);
        }
Example #29
0
        public void Test_CaseImport()
        {
            CrmConnection        crmConnection = (CrmConnection)connection.GetConnection();
            IOrganizationService service       = new OrganizationService(crmConnection);

            string accountName1 = Guid.NewGuid().ToString();
            Entity account      = new Entity("account");

            account.Attributes.Add("name", accountName1);
            Guid account1 = service.Create(account);

            IntegrationTool.Module.WriteToDynamicsCrm.WriteToDynamicsCrmConfiguration writeToCrmConfig = new IntegrationTool.Module.WriteToDynamicsCrm.WriteToDynamicsCrmConfiguration();
            writeToCrmConfig.EntityName = "incident";
            writeToCrmConfig.PrimaryKeyAttributes.Add("ticketnumber");
            writeToCrmConfig.ImportMode        = Module.WriteToDynamicsCrm.SDK.Enums.ImportMode.All;
            writeToCrmConfig.MultipleFoundMode = Module.WriteToDynamicsCrm.SDK.Enums.MultipleFoundMode.All;
            writeToCrmConfig.Mapping.Add(new IntegrationTool.DataMappingControl.DataMapping()
            {
                Source = "CaseID", Target = "ticketnumber"
            });
            writeToCrmConfig.Mapping.Add(new IntegrationTool.DataMappingControl.DataMapping()
            {
                Source = "CaseTitle", Target = "title"
            });

            writeToCrmConfig.RelationMapping.Add(new Module.WriteToDynamicsCrm.SDK.RelationMapping()
            {
                EntityName  = "account",
                LogicalName = "customerid",
                Mapping     = new List <DataMappingControl.DataMapping>()
                {
                    new DataMappingControl.DataMapping()
                    {
                        Source = "CompanyName",
                        Target = "name"
                    }
                }
            });
            writeToCrmConfig.ConfigurationId = Guid.NewGuid();
            writeToCrmConfig.SelectedConnectionConfigurationId = Test_Helpers.CRMCONNECTIONID;

            IDatastore dataObject = DataStoreFactory.GetDatastore();

            dataObject.AddColumn(new ColumnMetadata("CaseID"));
            dataObject.AddColumn(new ColumnMetadata("CaseTitle"));
            dataObject.AddColumn(new ColumnMetadata("CompanyName"));


            dataObject.AddData(new object[] { "CA-100", "101 Title", accountName1 });
            dataObject.AddData(new object[] { "CA-101", "Anöther Title", null });
            dataObject.AddData(new object[] { "CA-102", "A'Title\"chen", accountName1 });

            IModule module = Activator.CreateInstance(typeof(WriteToDynamicsCrm)) as IModule;

            module.SetConfiguration(writeToCrmConfig);

            ((IDataTarget)module).WriteData(connection, new DummyDatabaseInterface(), dataObject, Test_Helpers.ReportProgressMethod);

            service.Delete("account", account1);
        }
Example #30
0
 public DistributorNcaafb(IDataAccessNcaafb dataAccessNcaafb, IDatastore datastore, IPusherUtil pusherUtil)
 {
     _datastore  = datastore;
     _pusherUtil = pusherUtil;
     _marketList = dataAccessNcaafb.GetMarkets();
     InitializeLists();
 }
Example #31
0
        public WnbaGame(IDataAccessWnba dataAccessWnba, IRadarWnba radarWnba, IAnalyticaWnba analyticaWnba, IDatastore datastore, IDistributorWnba distributorWnba, IPubSubUtil pubSubUtil, IPusherUtil pusherUtil)
        {
            PeriodList = new List <string> {
                "CG", "H1", "H2", "Q1", "Q2", "Q3", "Q4"
            };
            InitializePeriodScoring(PeriodList);
            GameTimeSeconds = 2400;
            ModelData[WnbaModelDataKeys.InMlf]    = new Dictionary <string, double>();
            ModelData[WnbaModelDataKeys.InLMlf]   = new Dictionary <string, double>();
            ModelData[WnbaModelDataKeys.Evs]      = new Dictionary <string, double>();
            ModelData[WnbaModelDataKeys.InTsf]    = new Dictionary <string, double>();
            ModelData[WnbaModelDataKeys.Egt]      = new Dictionary <string, double>();
            ModelData[WnbaModelDataKeys.InLsF]    = new Dictionary <string, double>();
            ModelData[WnbaModelDataKeys.Settings] = new Dictionary <string, double>();

            WnbaGameState = new WnbaGameState();

            _dataAccessWnba  = dataAccessWnba;
            _analyticaWnba   = analyticaWnba;
            _datastore       = datastore;
            _distributorWnba = distributorWnba;
            _radarWnba       = radarWnba;
            _pubSubUtil      = pubSubUtil;
            _pusherUtil      = pusherUtil;
            _marketList      = dataAccessWnba.GetMarketsDescriptions();
        }
 public AccountProviderSelectPageViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     _dataStore = Init.GetDatastore();
     AccountProviders = new ObservableCollection<AccountProviderViewModel>();
     foreach (var provider in new Providers()) {
         AccountProviders.Add(new AccountProviderViewModel(provider));
     }
 }
Example #33
0
 public Accounts(IDatastore dataStore)
 {
     _dataStore = dataStore;
     _providers = new Providers();
     _fieldTypes = new FieldTypes();
     foreach (var accountDto in dataStore.GetAccountDtos()) {
         var account = new Account(_fieldTypes);
         account.Load(accountDto);
         _accounts.Add(account);
     }
 }
Example #34
0
        public void GenerateFakeData(IDatastore dataStore)
        {
            var facebookAccount = GetFacebookAccount();
            dataStore.SaveAccountDto(facebookAccount);

            var twitterAccount = GetTwitterAccount();
            dataStore.SaveAccountDto(twitterAccount);

            var google1Account = GetGoogle1Account();
            dataStore.SaveAccountDto(google1Account);

            var google2Account = GetGoogle2Account();
            dataStore.SaveAccountDto(google2Account);
        }
Example #35
0
 public void Initialize()
 {
     _datastore = new GoogleCloudDatastore("Pogo");
 }
Example #36
0
 public TestController(IDatastore db)
 {
     _db = db;
 }
Example #37
0
 public AccountSection(IDatastore dataStore)
 {
     _accounts = new Accounts(dataStore);
 }
Example #38
0
 public void AddDatastore(IDatastore dataStore)
 {
     _dataStores.Add(dataStore);
 }
Example #39
0
 public void SelectDatastore(IDatastore dataStore)
 {
     _currentDatastore = dataStore;
 }
Example #40
0
 //private void TestWithBothDatastores(Action<IDatastore> test) {
 //    test(GetDatastoreWithFakeData());
 //    test(GetDatastore());
 //}
 private void TestAccountAndPassword(IDatastore dataStore, AccountDto accountDto)
 {
     dataStore.GetAllAccountIds().Should().Contain(id => id.Equals(accountDto.Id));
     dataStore.GetAccountDtos().Should().Contain(dataStoreAccountDto => accountDto.Id == dataStoreAccountDto.Id);
     dataStore.GetAccountDto(accountDto.Id).Equals(accountDto).Should().BeTrue();
     dataStore.GetAccountDto(accountDto.Id).IsDeleted.Should().Be(accountDto.IsDeleted);
     dataStore.GetAccountDto(accountDto.Id).Id.Should().Be(accountDto.Id);
     dataStore.GetAccountDto(accountDto.Id).LastChangedUtc.Should().Be(accountDto.LastChangedUtc);
     dataStore.GetAccountDto(accountDto.Id).Notes.Should().Be(accountDto.Notes);
     dataStore.GetAccountDto(accountDto.Id).ProviderKey.Should().Be(accountDto.ProviderKey);
     dataStore.GetAccountDto(accountDto.Id).Tags.Should().Equal(accountDto.Tags);
     dataStore.GetAccountDto(accountDto.Id).Fields.Should().Equal(accountDto.Fields);
     //dataStore.GetPasswordDtos(accountDto.Id).Should().HaveCount(passwordDtos.Count());
     //dataStore.GetPasswordDtos(accountDto.Id).First().Equals(passwordDtos.First()).Should().BeTrue();
     //dataStore.GetPasswordDtos(accountDto.Id).Should().Equal(passwordDtos);
 }
 // creates service definition that can be registered with a server
 public static ServerServiceDefinition BindService(IDatastore serviceImpl)
 {
     return ServerServiceDefinition.CreateBuilder(__ServiceName)
       .AddMethod(__Method_Lookup, serviceImpl.Lookup)
       .AddMethod(__Method_RunQuery, serviceImpl.RunQuery)
       .AddMethod(__Method_BeginTransaction, serviceImpl.BeginTransaction)
       .AddMethod(__Method_Commit, serviceImpl.Commit)
       .AddMethod(__Method_Rollback, serviceImpl.Rollback)
       .AddMethod(__Method_AllocateIds, serviceImpl.AllocateIds).Build();
 }