public void GetProcGainTest() { TDPredictionGroup pg1 = new TDPredictionGroup(); TDPredictionGroup pg2 = new TDPredictionGroup(); pg1.TrafficService = new UnionCsService(); pg2.TrafficService = new UnionPsService(); TDCsService service1 = new TDCsService(); TDPsService service2 = new TDPsService(); ((UnionCsService)pg1.TrafficService).CSServiceDic[NetWorkType.TDSCDMA] = service1; ((UnionPsService)pg2.TrafficService).PSServiceDic[NetWorkType.TDSCDMA] = service2; TDR99Bearer TDR99Bearer = new TDR99Bearer(); service1.TDR99Bearer = TDR99Bearer; service2.TDR99Bearer = TDR99Bearer; float [] actual1=TDPredictionCommonCalc.GetProcGain(pg1); float[] actual2 = TDPredictionCommonCalc.GetProcGain(pg2); float[] expected1 = { service1.TDR99Bearer.UlPG, service1.TDR99Bearer.DlPG }; float[] expected2 = { service2.TDR99Bearer.UlPG, service2.TDR99Bearer.DlPG }; Assert.AreEqual(actual1, expected1); Assert.AreEqual(actual2, expected2); }
public void GetTxPowerTest() { TDPredictionGroup pg1= new TDPredictionGroup(); TDPredictionGroup pg2 = new TDPredictionGroup(); pg1.TrafficService = new UnionCsService(); pg2.TrafficService = new UnionPsService(); TDCsService service1 = new TDCsService(); TDPsService service2= new TDPsService(); ((UnionCsService)pg1.TrafficService).CSServiceDic[NetWorkType.TDSCDMA] = service1; ((UnionPsService)pg2.TrafficService).PSServiceDic[NetWorkType.TDSCDMA] = service2; TDR99Bearer TDR99Bearer = new TDR99Bearer(); service1.TDR99Bearer = TDR99Bearer; service2.TDR99Bearer = TDR99Bearer; float actual1=TDPredictionCommonCalc.GetTxPower(pg1); float actual2 = TDPredictionCommonCalc.GetTxPower(pg2); float expected1= service1.TDR99Bearer.PtchMax; float expected2 = service2.TDR99Bearer.PtchMax; Assert.AreEqual(expected1,actual1 ); Assert.AreEqual(expected2, actual2); }