public void getdata() { this.lbmodule1.Text = ModuleService.GetName(1); this.lbmodule2.Text = ModuleService.GetName(2); this.lbmodule3.Text = ModuleService.GetName(3); this.lbmodule4.Text = ModuleService.GetName(4); this.lbmodule5.Text = ModuleService.GetName(5); this.lbmodule6.Text = ModuleService.GetName(6); this.lbmodule7.Text = ModuleService.GetName(7); this.lbmodule8.Text = ModuleService.GetName(8); this.lbmodule9.Text = ModuleService.GetName(9); this.lbmodule10.Text = ModuleService.GetName(10); this.lbmodule11.Text = ModuleService.GetName(11); cbldata(cblmodule11, 11); cbldata(cblmodule10, 10); cbldata(cblmodule9, 9); cbldata(cblmodule8, 8); cbldata(cblmodule7, 7); cbldata(cblmodule6, 6); cbldata(cblmodule5, 5); cbldata(cblmodule4, 4); cbldata(cblmodule3, 3); cbldata(cblmodule2, 2); cbldata(cblmodule1, 1); if (Request["roleid"] != null) { this.lbrolename.Text = RoleService.GetRoleById(int.Parse(Request["roleid"])).rolename; this.hdback.Value = Request.UrlReferrer.ToString(); var dt = RankService.GetRank(int.Parse(Request["roleid"])); for (int i = 0; i < dt.Count; i++) { string moduleId = dt[i].moduleid.ToString(); getcheck(cblmodule11, moduleId); getcheck(cblmodule10, moduleId); getcheck(cblmodule9, moduleId); getcheck(cblmodule8, moduleId); getcheck(cblmodule7, moduleId); getcheck(cblmodule6, moduleId); getcheck(cblmodule5, moduleId); getcheck(cblmodule4, moduleId); getcheck(cblmodule3, moduleId); getcheck(cblmodule2, moduleId); getcheck(cblmodule1, moduleId); } } }
private static void AssertRanksAgainstExpectedResults(List <Programmer> programmers, IReadOnlyDictionary <string, double> expectedResults) { var programmerRepository = Substitute.For <INetworkRepository>(); programmerRepository.GetAll().Returns(programmers); programmers.ForEach(programmer => programmerRepository.GetById(programmer.GetId()).Returns(programmer)); programmers.ForEach(programmer => { var programmerId = programmer.GetId(); var expected = expectedResults[programmerId]; var rankService = new RankService(programmerRepository); var rank = rankService.GetRank(programmerId); Assert.That(rank, Is.EqualTo(expected).Within(0.01d)); }); }