private void fillGrid() { ddlOffice.DataSource = OfficeController.GetAllOffice(); ddlOffice.DataTextField = "Name"; ddlOffice.DataValueField = "OfficeKey"; ddlOffice.DataBind(); }
public void TestInitializer() { _unitOfWork = new MockUnitOfWork(); _mapper = ModelMapper.Create(); _officeController = new OfficeController(_mapper, _unitOfWork); _officeController.ControllerContext = Substitute.For <HttpControllerContext>(); _officeController.Request = new HttpRequestMessage(); _officeController.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration()); _officeController.Request.SetConfiguration(new HttpConfiguration()); _officeController.RequestContext.Principal = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.NameIdentifier, "1") })); }
void Awake() { hostile = GetComponent <HostileController>(); store = GetComponent <ObjectStore>(); placement = GetComponent <PlacementController>(); possession = GetComponent <PossessionHandler>(); office = GameObject.Find("LeMinotaure").GetComponent <OfficeController>(); foreach (PulseController pC in startingControllers) { pulseControllers.Add(pC); } screenCentreH = Screen.height / 2; screenCentreW = Screen.width / 2; }
public void Offices() { ILogger <OfficeController> _testlogger = null; using (var context = new AppDbContext(options, null)) { var controller = new OfficeController(context, _testlogger); // Get all var result = controller.Get(); // Assert var okResult = Assert.IsAssignableFrom <IEnumerable <Office> >(result); var pgcount = okResult.ToList().Count; Assert.Equal(2, pgcount); // Get by ID var result1 = controller.Get(1); var okResult1 = Assert.IsAssignableFrom <Microsoft.AspNetCore.Mvc.JsonResult>(result1); //var offceresult = JsonConvert.DeserializeObject<Office>(okResult1.ToString()); //Assert.Equal("office 1", offceresult.OfficeName); // test update var pg1 = new Office { OfficeID = 1, OfficeName = "office 1 upd" }; controller.UpdateEntry(pg1); var result3 = controller.Get(1); //Assert.NotEqual("team 1", result3.name); //Assert.Equal("team 1 upd", result3.TeamName); // test delete var result4 = controller.Get(2); //Assert.Equal("team 2", result4.name); IActionResult result5 = controller.Delete(2); var viewResult = Assert.IsType <Microsoft.AspNetCore.Mvc.OkResult>(result5); //var result6 = controller.Get(2); //Assert.Null(result6); } }
// Start is called before the first frame update void Awake() { office = transform.parent.gameObject.GetComponent <OfficeController>(); }
public static List <string> AutoCompleteAjaxRequest(string prefixText, int count) { var lstOffice = OfficeController.GetAllOffice(); return(lstOffice.Select(office => office.Name).ToList()); }
public static OfficeController Fixture() { OfficeController controller = new OfficeController(new OfficeRepository(), "", new LoginView()); return controller; }
public static OfficeController Fixture() { OfficeController controller = new OfficeController(new OfficeRepository(), "", new LoginView()); return(controller); }
public void SetUpMock() { var service = new OfficeServiceMock(); _controller = new OfficeController(service); }