//负载过高 public void AssignUnsuccess2() { AssignCell target2 = new AssignCell(-1); bool expected = false; bool actual; actual = target2.AssignCellForUser(user); Assert.AreEqual(expected, actual); }
public AssignCellTest() { maxLoad = 10; target = new AssignCell(maxLoad); user = MockUPAUser.CreateUPAuser(); List<TDSimCell> celllist = new List<TDSimCell>(); celllist.Add(cella); celllist.Add(cellb); TDSimTran tdtran = new TDSimTran(celllist); user.PrimeCell = cella; }
public string AssignCell([FromBody] AssignCell cell) { SqlConnection connection = new SqlConnection(connectionString); SqlCommand command = new SqlCommand("usp_assignCell", connection); command.Parameters.AddWithValue("@GridID", cell.grid); command.Parameters.AddWithValue("@x", cell.x); command.Parameters.AddWithValue("@y", cell.y); command.Parameters.AddWithValue("@status", cell.status); command.CommandType = CommandType.StoredProcedure; connection.Open(); SqlDataAdapter adapter = new SqlDataAdapter(command); DataTable table = new DataTable(); adapter.Fill(table); return(null); }
//负载过大 public void AssignUnsuccess6() { TDSimCell cell1 = MockUPAcell.CreatUPACell(true); List<TDSimCell> celllist = new List<TDSimCell>(); celllist.Add(cell1); TDSimTran tdtran = new TDSimTran(celllist); TDSimUser ue = MockUPAUser.CreateUPAuser(); ue.PrimeCell=cell1; cell1.HSUPATotalRate = 5; AssignCell target2 = new AssignCell(0); bool expected = false; bool actual; actual = target2.AssignCellForUser(ue); Assert.AreEqual(expected, actual); }