public void Setup() { inner = Substitute.For <Transport>(); GameObject gameObject = new GameObject(); middleware = gameObject.AddComponent <MyMiddleware>(); middleware.inner = inner; //manually call awake in editmode middleware.Awake(); }