// test merging new tally setup added to component one // after merge there should be new samplegroups and tally setup in master and component 2 public void PerformMergeTest_newCountTree2() { var masterPath = TESTMERGENEWCOUNTS2_MASTER; var numComps = 2; var(master, components) = FindFiles(masterPath); using (master) { var commandBuilders = MergeComponentsPresenter.MakeCommandBuilders(master); var commandBuilderDict = commandBuilders.ToDictionary(x => x.ClientTableName); var mergeLog = new TestMergeLogWriter(Output); PrepareMergeWorker.DoWork(master, components, commandBuilders, new System.Threading.CancellationToken(), (IProgress <int>)null, TestMergeLogWriter); MergeSyncWorker.DoMerge(master, components, commandBuilderDict, new System.Threading.CancellationToken(), (IProgress <int>)null, TestMergeLogWriter); var comp1 = components.ElementAt(0); var comp2 = components.ElementAt(1); comp2.Database.From <CountTreeDO>().Where("SampleGroup_CN > 1").Query().ToArray(); var comp1CtCount = comp1.Database.ExecuteScalar <int>("SELECT count(*) FROM CountTree;"); var comp2CtCount = comp2.Database.ExecuteScalar <int>("SELECT count(*) FROM CountTree;"); var masterCtCount = master.ExecuteScalar <int>("SELECT count(*) FROM CountTree WHERE Component_CN IS NULL;"); masterCtCount.Should().Be(comp1CtCount); comp2CtCount.Should().Be(comp1CtCount); } }
public Comp_TestBase(ITestOutputHelper output) : base(output) { TestMergeLogWriter = new TestMergeLogWriter(output); }