// Start is called before the first frame update public void start() { MainCameraResetPosition = mainCamera.transform.position; //Move the GetComponent to the Start method and cache the components on your private variables _DumptruckVC = DumpTruck.GetComponent <WSMVehicleController>(); _DumptruckController = DumpTruck.GetComponent <DumpTruckController>(); //only one backhoe in actual test _BackhoeVC = Backhoe.GetComponent <WSMVehicleController>(); _BackhoeController = Backhoe.GetComponent <BackhoeController>(); if (enable) { enable = false; } else { enable = true; } if (enable) { StartCoroutine(ActionSequence()); //activate indicator arrow DumpTruck.transform.Find("Arrow").gameObject.SetActive(true); } }
/// <summary> /// Setup the test /// </summary> public DumpTruckUnitTest() { DbContextOptions <DbAppContext> options = new DbContextOptions <DbAppContext>(); Mock <DbAppContext> dbAppContext = new Mock <DbAppContext>(null, options); DumpTruckService _service = new DumpTruckService(dbAppContext.Object); _DumpTruck = new DumpTruckController(_service); }
/// <summary> /// Setup the test /// </summary> public DumpTruckUnitTest() { DbContextOptions <DbAppContext> options = new DbContextOptions <DbAppContext>(); Mock <DbAppContext> dbAppContext = new Mock <DbAppContext>(null, options); /* * * Here you will need to mock up the context. * * ItemType fakeItem = new ItemType(...); * * Mock<DbSet<ItemType>> mockList = MockDbSet.Create(fakeItem); * * dbAppContext.Setup(x => x.ModelEndpoint).Returns(mockItem.Object); * */ DumpTruckService _service = new DumpTruckService(dbAppContext.Object); _DumpTruck = new DumpTruckController(_service); }