public void Test_DumpLteENodebData() { eNodebDumpRepository.Setup(x => x.InvokeAction(It.IsAny <IExcelBtsImportRepository <ENodebExcel> >())) .Callback <IExcelBtsImportRepository <ENodebExcel> >(x => eNodebDumpRepository.SetupGet(e => e.ImportBts).Returns(true)); Mock <IExcelBtsImportRepository <ENodebExcel> > eNodebInfos = new Mock <IExcelBtsImportRepository <ENodebExcel> >(); infrastructure.LteENodebRepository = eNodebInfos.Object; Assert.IsFalse(eNodebDumpRepository.Object.ImportBts); generator.DumpLteData(infrastructure, controller.Object, config.Object); Assert.IsTrue(eNodebDumpRepository.Object.ImportBts); }
private async void DumpToDb_Click(object sender, RoutedEventArgs e) { WinDumpController controller = new WinDumpController(); ParametersDumpGenerator generater = new ParametersDumpGenerator { LteENodebDumpGenerator = (c, i) => new LteENodebDumpRepository( c.TownRepository, c.ENodebRepository, i), LteCellDumpGenerator = (c, i) => new LteCellDumpRepository( c.CellRepository, c.ENodebRepository, c.BtsRepository, c.CdmaCellRepository, i), CdmaBtsDumpGenerator = (c, i) => new CdmaBtsDumpRepository( c.TownRepository, c.ENodebRepository, c.BtsRepository, i), CdmaCellDumpGenerator = (c, i) => new CdmaCellDumpRepository( c.BtsRepository, c.CdmaCellRepository, i), MmlDumpGenerator = (c, i) => new MmlDumpRepository(c.BtsRepository, c.CdmaCellRepository, i) }; await Task.Run(() => { generater.DumpLteData(infrastructure, controller, dumpConfig); generater.DumpMmlData(infrastructure, controller); generater.DumpCdmaData(infrastructure, controller, dumpConfig); MessageBox.Show("新增LTE基站:" + infrastructure.ENodebInserted + "\n更新LTE基站:" + infrastructure.ENodebsUpdated + "\n新增LTE小区:" + infrastructure.CellsInserted + "\n更新LTE小区:" + infrastructure.CellsUpdated + "\n更新LTE邻区PCI:" + infrastructure.NeighborPciUpdated + "\n新增CDMA基站:" + infrastructure.CdmaBtsUpdated + "\n新增CDMA小区:" + infrastructure.CdmaCellsInserted + "\n更新CDMA小区:" + infrastructure.CdmaCellsUpdated, "执行结果"); }); }