public void CalcInterfereVale_Test() { InterfereCalculator interfereCalculator = new InterfereCalculator(); IGetLinkloss linkLoss = new MockIGetLinkloss(); IInterfCalc interfCalc = new MockIInterfCalc(); ISmartAntCalcGain smartAntCalcGain = new MockISmartAntCalcGain(); interfereCalculator.Initialization(linkLoss, interfCalc, smartAntCalcGain); TDSimUser user; user = MockDPAUser.CreatTDSimUser_CS(); TDSimUser user1; user1 = MockDPAUser.CreatTDSimUser_CS(); TDSimUser user2; user2 = MockDPAUser.CreatTDSimUser_CS(); TDSimUser userR4; userR4 = MockDPAUser.CreatTDSimUser_CS(); TS timeSlot = new TS(); TDSimCell tdCell; tdCell = MockCell.CreatTDSimCell(); TDSimCell tdInterCell; tdInterCell = MockCell.CreatTDSimCell(); tdInterCell.NeCell.FreqBand.DLFrequency = 1900f; user.ServiceCell.TDIntefCells.Add(tdCell); user.ServiceCell.TDIntefCells.Add(tdInterCell); tdCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1); tdCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4); tdInterCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1); tdInterCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4); user.ServiceCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user1); user.ServiceCell.Slots[(int)timeSlot].HSDPAScheduledUsers.Add(user2); user.ServiceCell.Slots[(int)timeSlot].AccessedUsers.Add(userR4); //ISimCellBase GSMCell = new MockISimCellBase(); //GSMCell.Cell.FreqBand = new FrequencyBand(); //GSMCell.Cell.FreqBand.BandWidth = 10000; //ISimCellBase UMTSCell = new MockISimCellBase(); //UMTSCell.Cell.FreqBand = new FrequencyBand(); //UMTSCell.Cell.FreqBand.BandWidth = 20000; //List<ISimCellBase> GSMInterf = new List<ISimCellBase>(); //List<ISimCellBase> UMTSInterf = new List<ISimCellBase>(); //GSMInterf.Add(GSMCell); //UMTSInterf.Add(UMTSCell); //user.ServiceCell.GSMIntefCells = GSMInterf; //user.ServiceCell.UMTSIntefCells = UMTSInterf; Assert.AreEqual((int)(interfereCalculator.CalcInterfereVale(user, timeSlot)), 3.0); }
public void GetSmartAntSideGain_Test() { TDSimUser curUser; curUser = MockDPAUser.CreatTDSimUser_CS(); TDSimUser infUser; infUser = MockDPAUser.CreatTDSimUser_CS(); InterfereCalculator interfereCalculator = new InterfereCalculator(); IGetLinkloss linkLoss = new MockIGetLinkloss(); IInterfCalc interfCalc = new MockIInterfCalc(); ISmartAntCalcGain smartAntCalcGain = new MockISmartAntCalcGain(); interfereCalculator.Initialization(linkLoss, interfCalc, smartAntCalcGain); float sideGain = interfereCalculator.GetSmartAntSideGain(curUser, infUser); Assert.AreEqual(sideGain, 11f); }