public void SearchListTest_return_List_byCategory_PostingState() { //Arrange string action = "PostingState"; SearchParameter search = new SearchParameter() { Operate = action, SchoolYear = "20192020", PositionType = "LTO", SearchType = action }; // Act var testDDLControl = new System.Web.UI.WebControls.DropDownList(); string expect = "New Posting"; int expect2 = 9; string intitalValue = "New Posting"; object datasourceList = GeneralExe.SearchList(search); AssemblingList.SetLists(testDDLControl, datasourceList, "Value", "Name", intitalValue); string result = testDDLControl.SelectedItem.Text; int result2 = testDDLControl.Items.Count - 1; //Assert Assert.AreEqual(expect, result, $"Search by Posting State, Select Value { result}"); Assert.AreEqual(expect2, result2, $" Totel Posting state is { result2}"); }