示例#1
0
 public PopulateSandbox(SbbInstructionSet instructions, RelationMapper relMapper)
 {
     _sourceTasks    = new SalesforceTasks(instructions.SourceCredentials);
     _targetTasks    = new SalesforceTasks(instructions.TargetCredentuals);
     _instructions   = instructions;
     _relationMapper = relMapper;
 }
示例#2
0
        private SbbInstructionSet LoadInstructions()
        {
            ShowMessage(string.Format("Loading instructions from {0} ...", uxInstructionsFilename.Text));
            var instructions = SbbInstructionSet.LoadFromFile(uxInstructionsFilename.Text);

            ShowMessage(string.Format("Instructions loaded."));

            // add credentials to instructions
            instructions.SourceCredentials = GetSourceCredentials();
            instructions.TargetCredentuals = GetTargetCredentials();
            return(instructions);
        }
示例#3
0
        public static SbbInstructionSet MakeInstructionSet(List <string> objNames)
        {
            var ret = new SbbInstructionSet();

            ret.SourceCredentials = MakeDummyCredentials();
            ret.TargetCredentuals = MakeDummyCredentials();
            ret.SbbObjects        = new List <SbbObject>();
            foreach (string nameLoop in objNames)
            {
                var o = new SbbObject();
                o.ApiName = nameLoop;
                ret.SbbObjects.Add(o);
            }
            return(ret);
        }
示例#4
0
        public void CanSerializeInstructions()
        {
            string[] tables = { "Country__c", "Nationality__c",
                                "Account",    "Client__c" };


            SbbInstructionSet inst = TestUtils.MakeInstructionSet(tables.ToList());

            inst.SbbObjects.First(o => o.ApiName == "Account").Filter   = "Help_Sandbox_Data_Set__c = true";
            inst.SbbObjects.First(o => o.ApiName == "Client__c").Filter = "account__r.Help_Sandbox_Data_Set__c = true";


            var baseDir  = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            var testFile = System.IO.Path.Combine(baseDir, "testinstructions.xml");

            SbbInstructionSet.SaveToFile(testFile, inst);
        }
示例#5
0
 public PopulateSandbox(SbbInstructionSet instructions) : this(instructions, new RelationMapper())
 {
 }