Exemplo n.º 1
0
        [TestInitialize]  //初始化测试用例
        public void MyTestInitialize()
        {
            m_Index = 0;
            m_Name = "GSMCodingScheme";
            m_Context = new Context();
            m_Case = new CodingSchemeCase();

            IACell cell = Mock.CreatGsmCell();
            group = Mock.MockGSMPredicGroup();
            TrueFalseMatrix tFMatrix = new TrueFalseMatrix(4, 4, 0, 200, 50, true);

            LinkLossAssist.Init();

            IProjectManager projectMgr = ServiceHelper.Lookup<MockIProjectManager>(ProjectSingleton.CurrentProject.AppContext);
            string absolutePath1 = ResultFilePath.CreateFilePath(projectMgr.CurrentProjectLossPath, group.Name, group.Region.Name, GSMPredictionStudyType.BestServer.ToString());
            string relativePath1 = ResultFilePath.CreateRelativePath(group.Name, group.Region.Name, GSMPredictionStudyType.BestServer.ToString());
            ShortResultStruct srs1 = ShortResultStruct.DefaultMax;
            gsmBestServerID = ValueMatrixAssist.GenerateByTrueFalseMatrix(tFMatrix, absolutePath1, relativePath1, srs1);
            gsmBestServerID[0] = cell.ID;

            string absolutePath2 = ResultFilePath.CreateFilePath(projectMgr.CurrentProjectLossPath, group.Name, group.Region.Name, GSMPredictionStudyType.DLServiceCIR.ToString());
            string relativePath2 = ResultFilePath.CreateRelativePath(group.Name, group.Region.Name, GSMPredictionStudyType.DLServiceCIR.ToString());
            ShortResultStruct srs2 = ShortResultStruct.DefaultMin;
            ValueMatrixShort gsmDLServiceCIR = ValueMatrixAssist.GenerateByTrueFalseMatrix(tFMatrix, absolutePath2, relativePath2, srs2);
            gsmDLServiceCIR[0] = 26 * 100;

                        
            //ITrafficForApplication trafficForApplication=new MockITrafficForApplication();

            m_Context.Add(ContextKeys.Group, group);
            m_Context.Add(ContextKeys.TFMatrix, tFMatrix);
            m_Context.Add(ContextKeys.ApplicationContext, ProjectSingleton.CurrentProject.AppContext);
            m_Context.Add(ContextKeys.GSMBestServerID, gsmBestServerID);
            m_Context.Add(ContextKeys.GSMDLServiceCIR, gsmDLServiceCIR);
        }
Exemplo n.º 2
0
Arquivo: Mock.cs Projeto: xiaoyj/Space
        public static GSMPredicGroup MockGSMPredicGroup()
        {
            GSMPredicGroup group = new GSMPredicGroup();
            group.Name = "group1";
            group.Region = MockRegion.CreateRegion();
            group.Region.Name = "region1";

            #region mock GSM 的Terminal
            Terminal temp = new Terminal();
            temp.ID = 0;
            List<NetworkTerminal> m_List = new List<NetworkTerminal>();
            GSMTerminal gsmTerminal1 = new GSMTerminal();
            gsmTerminal1.NetType = NetWorkType.GSM;
            gsmTerminal1.Technology = GsmTechnologyType.GSM;
            m_List.Add(gsmTerminal1);
            GSMTerminal gsmTerminal2 = new GSMTerminal();
            gsmTerminal2.NetType = NetWorkType.GSM;
            gsmTerminal2.Technology = GsmTechnologyType.GPRS;
            m_List.Add(gsmTerminal2);
            GSMTerminal gsmTerminal3 = new GSMTerminal();
            gsmTerminal3.NetType = NetWorkType.GSM;
            gsmTerminal3.Technology = GsmTechnologyType.EGPRS;
            m_List.Add(gsmTerminal3);
            temp.NetTerminalList = m_List;
            group.TrafficTerminal =temp;
            #endregion

            return group;
        }
Exemplo n.º 3
0
        public void MyTestInitialize()
        {
            m_Index = 0;
            m_Name = "DLInterf";
            m_Context = new Huawei.UNet.Prediction.CalculateInterface.Context();
            m_Case = new DLInterfCase();
            cellList = new List<IACell>();
            TrueFalseMatrix matrix = new TrueFalseMatrix(4, 4, 0.0, 200, 50, true);
            LinkLossAssist.Init();

            GSMPredicGroup group = new GSMPredicGroup();
            group.Region = MockRegion.CreateRegion();
            group.Name = "GSMPredicGroup";
            group.CsService = new Huawei.UNet.Traffic.Interface.UnionCsService();
            group.TrafficTerminal = new Huawei.UNet.Traffic.Interface.Terminal();

            IProjectManager projectMgr = ServiceHelper.Lookup<MockIProjectManager>(ProjectSingleton.CurrentProject.AppContext);
            string absolutePathID = ResultFilePath.CreateFilePath(projectMgr.CurrentProjectLossPath, group.Name, group.Region.Name, ContextKeys.GSMBestServerID);
            string relativePathID = ResultFilePath.CreateRelativePath(group.Name, group.Region.Name, ContextKeys.GSMBestServerID);
            string absolutePathRSCP = ResultFilePath.CreateFilePath(projectMgr.CurrentProjectLossPath, group.Name, group.Region.Name, ContextKeys.GSMBCCHRP);
            string relativePathRSCP = ResultFilePath.CreateRelativePath(group.Name, group.Region.Name, ContextKeys.GSMBCCHRP);
            ShortResultStruct srsID = ShortResultStruct.DefaultMax;
            ShortResultStruct srsRSCP = ShortResultStruct.DefaultMin;
            m_BestServerID = ValueMatrixAssist.GenerateByTrueFalseMatrix(matrix, absolutePathID, relativePathID, srsID);
            m_BestServerRSCP = ValueMatrixAssist.GenerateByTrueFalseMatrix(matrix, absolutePathRSCP, relativePathRSCP, srsRSCP);
            m_BestServerID[0] = 0;
            m_BestServerRSCP[0] = -9000;
       
            //InitCellList();

            //double[] x = new double[3] { 50, 100, 150 };
            //double[] y = new double[3] { 50, 100, 50 };
            //MockCellList.CreateCellList(cellList, x, y);
            TrafficAdaptorMgr trafficMgr = TrafficAdaptorMgr.Instance;
            m_InterfTable = trafficMgr.TableDIC;

            m_Context.Add(ContextKeys.InterfTable, m_InterfTable);
            m_Context.Add(ContextKeys.Group, group);
            m_Context.Add(ContextKeys.TFMatrix, matrix);
            m_Context.Add(ContextKeys.ApplicationContext, ProjectSingleton.CurrentProject.AppContext);
            m_Context.Add(ContextKeys.GSMBestServerID, m_BestServerID);
            m_Context.Add(ContextKeys.GSMBCCHRP, m_BestServerRSCP);
            m_Case.Name = m_Name;
            m_Context.Add(ContextKeys.CellList, cellList);
            m_Case.InitialCase(m_Context);
            //for (int i = 0; i < 3;i++ )
            //{
            //    m_Context.Add(ContextKeys.CurrentCalcCell, cellList[i]);
            //    RunCase();
            //    m_Context.Remove(ContextKeys.CurrentCalcCell);
            //}
        }
Exemplo n.º 4
0
        [TestInitialize]  //初始化测试用例
        public void MyTestInitialize()
        {
            m_Index = 0;
            m_Name = "CoverageArea";

            m_Context = new Context();
            m_Case = new CoverageAreaCase();

            group = Mock.MockGSMPredicGroup();
            TrueFalseMatrix tFMatrix = new TrueFalseMatrix(4, 4, 0, 200, 50, true);
            IACell cell = Mock.CreatGsmCell();
            cellList = new List<IACell>();
            double[] x = new double[1] { 100 };
            double[] y = new double[1] { 100 };
            cellList.Add(cell);
            cellList = MockCellList.CreateCellList(cellList, x, y);
            cellList[0].Parent.ID = 1;
            LinkLossAssist.Init();
            IProjectManager projectMgr = ServiceHelper.Lookup<MockIProjectManager>(ProjectSingleton.CurrentProject.AppContext);

            string absolutePath2 = ResultFilePath.CreateFilePath(projectMgr.CurrentProjectLossPath, group.Name, group.Region.Name, GSMPredictionStudyType.BestServer.ToString());
            string relativePath2 = ResultFilePath.CreateRelativePath(group.Name, group.Region.Name, GSMPredictionStudyType.BestServer.ToString());
            ShortResultStruct srs2 = ShortResultStruct.DefaultMax;
            m_GSMBestServerID = ValueMatrixAssist.GenerateByTrueFalseMatrix(tFMatrix, absolutePath2, relativePath2, srs2);
            m_GSMBestServerID[m_Index] = cellList[0].ID;

            string absolutePath = ResultFilePath.CreateFilePath(projectMgr.CurrentProjectLossPath, group.Name, group.Region.Name, GSMPredictionStudyType.DLServiceCIR.ToString());
            string relativePath = ResultFilePath.CreateRelativePath(group.Name, group.Region.Name, GSMPredictionStudyType.DLServiceCIR.ToString());
            ShortResultStruct srs = ShortResultStruct.DefaultMin;
            m_GSMDLServiceCIR = ValueMatrixAssist.GenerateByTrueFalseMatrix(tFMatrix, absolutePath, relativePath, srs);
            m_GSMDLServiceCIR[m_Index] = 18 * 100;

            string absolutePath1 = ResultFilePath.CreateFilePath(projectMgr.CurrentProjectLossPath, group.Name, group.Region.Name, GSMPredictionStudyType.CodingScheme.ToString());
            string relativePath1 = ResultFilePath.CreateRelativePath(group.Name, group.Region.Name, GSMPredictionStudyType.CodingScheme.ToString());
            ShortResultStruct srs1 = ShortResultStruct.DefaultMin;
            m_CodingScheme = ValueMatrixAssist.GenerateByTrueFalseMatrix(tFMatrix, absolutePath1, relativePath1, srs1);
            m_CodingScheme[0] = 4;
            m_CodingScheme[11] = 11;
            m_Context.Add(ContextKeys.CellList, cellList);
            m_Context.Add(ContextKeys.CurrentCalcCell, cellList[0]);
            m_Context.Add(ContextKeys.Group, group);
            m_Context.Add(ContextKeys.TFMatrix, tFMatrix);
            m_Context.Add(ContextKeys.ApplicationContext, ProjectSingleton.CurrentProject.AppContext);
            m_Context.Add(ContextKeys.GSMBestServerID, m_GSMBestServerID);
            m_Context.Add(ContextKeys.GSMDLServiceCIR, m_GSMDLServiceCIR);
            m_Context.Add(ContextKeys.CodingScheme, m_CodingScheme);

        }
Exemplo n.º 5
0
        public void MyTestInitialize()
        {
            m_Index = 0;
            m_Name = "TCHRP";

            m_Context = new Context();
            m_Case = new TCHRPCase();

            group = Mock.MockGSMPredicGroup();
            TrueFalseMatrix tFMatrix = new TrueFalseMatrix(4, 4, 0, 200, 50, true);
            IACell cell1 = Mock.CreatGsmCell();
            IACell cell2 = Mock.CreatGsmCell();
            cellList = new List<IACell>();
            double[] x = new double[2] { 100, 150 };
            double[] y = new double[2] { 100, 150 };
            cellList.Add(cell1);
            cellList.Add(cell2);
            cellList = MockCellList.CreateCellList(cellList, x, y);
            cellList[1].Parent.ID = 1;
            ((GSMTRX)cellList[0]).TRXPower = 46;
            LinkLossAssist.Init();
            IProjectManager projectMgr = ServiceHelper.Lookup<MockIProjectManager>(ProjectSingleton.CurrentProject.AppContext);

            string absolutePath2 = ResultFilePath.CreateFilePath(projectMgr.CurrentProjectLossPath, group.Name, group.Region.Name, GSMPredictionStudyType.BestServer.ToString());
            string relativePath2 = ResultFilePath.CreateRelativePath(group.Name, group.Region.Name, GSMPredictionStudyType.BestServer.ToString());
            ShortResultStruct srs2 = ShortResultStruct.DefaultMax;
            m_BestServerID = ValueMatrixAssist.GenerateByTrueFalseMatrix(tFMatrix, absolutePath2, relativePath2, srs2);
            m_BestServerID[m_Index] = cellList[0].ID;
            //m_GSMTCHRP[m_Index] = 46 * 100;
            m_Context.Add(ContextKeys.CellList, cellList);
            m_Context.Add(ContextKeys.CurrentCalcCell, cellList[0]);
            m_Context.Add(ContextKeys.Group, group);
            m_Context.Add(ContextKeys.TFMatrix, tFMatrix);
            m_Context.Add(ContextKeys.ApplicationContext, ProjectSingleton.CurrentProject.AppContext);
            m_Context.Add(ContextKeys.GSMBestServerID, m_BestServerID);

        }