Example #1
0
        public void SaveCarrierResultInSnapshot_Test()
        {
            TDSimUser user1;
            user1 = MockDPAUser.CreatTDSimUser_CS();
            TDSimUser user2;
            user2 = MockDPAUser.CreatTDSimUser_CS();
            user2.IsPolyModelUser = true;
            List<TDSimUser> tdPreUser = new List<TDSimUser>();
            tdPreUser.Add(user1);
            tdPreUser.Add(user2);

            TDSimCell cell1;
            cell1 = MockCell.CreatTDSimCell();
            cell1.HSDPAAceessErrorCount = 10;
            cell1.HSDPAServedUserList.Add(user1);
            cell1.HSDPAAvrgTxpower = 36f;
            TDSimCell cell2;
            cell2 = MockCell.CreatTDSimCell();
            cell2.HSDPAAceessErrorCount = 5;
            cell2.HSDPAServedUserList.Add(user2);
            List<TDSimCell> cellList = new List<TDSimCell>();
            cellList.Add(cell1);
            cellList.Add(cell2);

            DPAResult dpaResult = new DPAResult(tdPreUser);
            dpaResult.SaveCarrierResultInSnapshot(cellList);

            int diff = dpaResult.CellResult[0].HSDPAAceessErrorCount-dpaResult.CellResult[1].HSDPAAceessErrorCount;
            Assert.AreEqual(diff, 5);
            
        }
Example #2
0
        public void SaveUserResultInSnapshot_Test()
        {
            TDSimUser user1;
            user1 = MockDPAUser.CreatTDSimUser_CS();
            TDSimUser user2;
            user2 = MockDPAUser.CreatTDSimUser_CS();
            user2.HSDPABingdingBearer = null;
            user2.HSDPABearerCandidateList = null;
            TDSimUser user3;
            user3 = MockDPAUser.CreatTDSimUser_CS();
            user3.HSDPABingdingBearer = null;
            user3.HSDPABearerCandidateList = null;
            List<TDSimUser> tdPreUser = new List<TDSimUser>();
            tdPreUser.Add(user1);
            tdPreUser.Add(user2);
            List<TDSimUser> accessedUserList = new List<TDSimUser>();
            accessedUserList.Add(user1);
            accessedUserList.Add(user2);
            List<TDSimUser> unAccessedUserList = new List<TDSimUser>();
            unAccessedUserList.Add(user3);

            DPAResult dpaResult = new DPAResult(tdPreUser);
            dpaResult.SaveUserResultInSnapshot(accessedUserList, unAccessedUserList);
            Assert.AreEqual(user2.FailReason, user3.FailReason);
        }
Example #3
0
        public void ConvertListToDataTable_Test()
        {
            TDSimUser user1;
            user1 = MockDPAUser.CreatTDSimUser_CS();
            TDSimUser user2;
            user2 = MockDPAUser.CreatTDSimUser_CS();

            List<TDSimUser> tdPreUser = new List<TDSimUser>();
            tdPreUser.Add(user1);
            tdPreUser.Add(user2);
            DPAResult dpaResult = new DPAResult(tdPreUser);

            List<AccessedUserResult> accessedUserResultList = new List<AccessedUserResult>();
            List<UnAccessedUserResult> unAccessedUserResultList = new List<UnAccessedUserResult>();
            List<CellResult> cellResultList = new List<CellResult>();

            AccessedUserResult accessedUserResult = new AccessedUserResult();
            UnAccessedUserResult unAccessedUserResult = new UnAccessedUserResult();
            CellResult cellResult = new CellResult();

            accessedUserResult.BestServerName = "acc server";
            accessedUserResult.UserID = 1;

            unAccessedUserResult.AccessErrorType = "not fit";
            unAccessedUserResult.UserID = 2;

            cellResult.CellName = "cellResult Name";
            cellResult.HSDPAAceessErrorCount = 2;
            cellResult.HSDPAAvrgBlock = 0.12f;
            cellResult.HSDPAAvrgThrowput = 400000d;
            cellResult.HSDPAAvrgTxpower = 36f;
            cellResult.HSDPAReqMultiUserNum = 0;
            cellResult.HSDPAReqSingleUserNum = 2;
            cellResult.ServedMultiModeUserNum = 0;
            cellResult.ServedSingleModeUserNum = 2;
            cellResult.UnServedMultiModeUserNum = 0;
            cellResult.UnServedSingleModeUserNum = 0;

            accessedUserResultList.Add(accessedUserResult);
            unAccessedUserResultList.Add(unAccessedUserResult);
            cellResultList.Add(cellResult);

            dpaResult.CellResult = cellResultList;
            dpaResult.AccessedUserResult = accessedUserResultList;
            dpaResult.UnAccessedUserResult = unAccessedUserResultList;

            dpaResult.ConvertListToDataTable();
            Assert.AreEqual(dpaResult.DTList[0].Columns.Count, dpaResult.DTList[1].Columns.Count,(dpaResult.GetExcelResult().Count-1));


            HSDPAResultManager resultManager = new HSDPAResultManager();
            //IResult result = new MockIResult();
            //object obj = new object();
            //result = (IResult)dpaResult;
            //obj = result;
            //List<object> objList = new List<object>();
            //objList.Add(obj);

            //resultManager.DPAResultList.Add(dpaResult);

            //DataTable dt = (DataTable)(resultManager.GetAverageResult(objList));
            //Assert.AreEqual(dt.Columns.Count, 11);

            //SimuResultStruct simuResultStruct = new SimuResultStruct();
            //simuResultStruct = resultManager.GetNetworkResult(objList);
            //Assert.AreEqual(simuResultStruct.ULLoad, 0);

        }