public void Can_Filter_Games() { Mock <IMobileRepository> mock = new Mock <IMobileRepository>(); mock.Setup(m => m.Mobiles).Returns(new List <Mobile> { new Mobile { MobileId = 1, Name = "Mobile1", Category = "Cat1" }, new Mobile { MobileId = 2, Name = "Mobile2", Category = "Cat2" }, new Mobile { MobileId = 3, Name = "Mobile3", Category = "Cat1" }, new Mobile { MobileId = 4, Name = "Mobile4", Category = "Cat2" }, new Mobile { MobileId = 5, Name = "Mobile5", Category = "Cat3" } }); MobileController controller = new MobileController(mock.Object); controller.pageSize = 3; // Action List <Mobile> result = ((MobilesListViewModel)controller.List("Cat2", 1).Model) .Mobiles.ToList(); // Assert Assert.AreEqual(result.Count(), 2); Assert.IsTrue(result[0].Name == "Mobile2" && result[0].Category == "Cat2"); Assert.IsTrue(result[1].Name == "Mobile4" && result[1].Category == "Cat2"); }
void Start() { chController = GetComponent <CharacterController>(); chAnimator = GetComponent <Animator>(); //if android && !unity editor mContr = GameObject.FindGameObjectWithTag("Joystick").GetComponent <MobileController>(); }
void Start() { ch_controller = GetComponent <CharacterController>(); ch_animator = GetComponent <Animator>(); mContr = GameObject.FindGameObjectWithTag("Joystick").GetComponent <MobileController>(); mContrJoy2 = GameObject.FindGameObjectWithTag("Joystick2").GetComponent <MobileController>(); }
public void Can_Paginate() { Mock <IMobileRepository> mock = new Mock <IMobileRepository>(); mock.Setup(m => m.Mobiles).Returns(new List <Mobile> { new Mobile { MobileId = 1, Name = "Mobile1" }, new Mobile { MobileId = 2, Name = "Mobile2" }, new Mobile { MobileId = 3, Name = "Mobile3" }, new Mobile { MobileId = 4, Name = "Mobile4" }, new Mobile { MobileId = 5, Name = "Mobile5" } }); MobileController controller = new MobileController(mock.Object); controller.pageSize = 3; MobilesListViewModel result = (MobilesListViewModel)controller.List(null, 2).Model; List <Mobile> mobiles = result.Mobiles.ToList(); Assert.IsTrue(mobiles.Count == 2); Assert.AreEqual(mobiles[0].Name, "Mobile4"); Assert.AreEqual(mobiles[1].Name, "Mobile5"); }
public void Can_Retrieve_Image_Data() { Mobile mobile = new Mobile { MobileId = 2, Name = "Mobile2", ImageData = new byte[] { }, ImageMimeType = "image/png" }; Mock <IMobileRepository> mock = new Mock <IMobileRepository>(); mock.Setup(m => m.Mobiles).Returns(new List <Mobile> { new Mobile { MobileId = 1, Name = "Mobile1" }, mobile, new Mobile { MobileId = 3, Name = "Mobile3" } }.AsQueryable()); MobileController controller = new MobileController(mock.Object); ActionResult result = controller.GetImage(2); Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(FileResult)); Assert.AreEqual(mobile.ImageMimeType, ((FileResult)result).ContentType); }
private void Awake() { if (Instance == null) { Instance = this; } }
private void Start() { oldSpeed = speedMove; mContr = GameObject.FindGameObjectWithTag("Joystick").GetComponent <MobileController>(); ch_controller = GetComponent <CharacterController>(); Timer = GameObject.FindGameObjectsWithTag("Timer")[0]; StartCoroutine(StopSeekerforSeconds()); }
// Start is called before the first frame update void Start() { accelStartY = Input.acceleration.y; audio = GetComponent <AudioSource>(); mContr = GameObject.FindGameObjectWithTag("joyStick").GetComponent <MobileController>(); }
private void Awake() { isMaster = false; instance = this; gamePanel.SetActive(false); lobby.SetActive(false); loadingPanel.SetActive(true); endGame.SetActive(false); }
public void RegisterTest() { MobileController a = new MobileController(); RegisterViewModel model = new RegisterViewModel { Email = "*****@*****.**", Password = "******", ConfirmPassword = "******" }; // a.CreateUserAsync(model); }
private void SelectNewPlayer() { if (listSize > 0) { selectedPlayer = playersAvailable[0]; mobileController = selectedPlayer.GetComponent <MobileController>(); mobileController.enabled = true; mobileController.isSelected = true; } }
// Use this for initialization void Start() { b = true; a = true; em = bomb.GetComponent <EnemyMovement>(); em1 = bomb1.GetComponent <EnemyMovement>(); ps = bomb.transform.GetChild(0).GetComponent <ParticleSystem>(); ps1 = bomb1.transform.GetChild(0).GetComponent <ParticleSystem>(); ch_controller = GetComponent <CharacterController>(); ch_animator = GetComponent <Animator>(); mContr = GameObject.FindGameObjectWithTag("Joystick").GetComponent <MobileController>(); UIjump = false; }
void Awake() { isFrozen = false; //DontDestroyOnLoad(gameObject); anim = GetComponentInChildren <Animator>(); moveRight = 0; moveLeft = 0; controlsPaused = false; myAudioSrc = GetComponent <AudioSource>(); myAudioSrc.clip = DeathNoise; punching = false; isDead = false; StrengthsList = GameObject.FindGameObjectWithTag("Master"). GetComponent <Master>().GetStrengthList(); CBUG.Log("Str List: " + StrengthsList.ToStringFull()); jumpForceTemp = 0f; SpeedTemp = 0f; attackDisableDelay = new WaitForSeconds(AttackLife); facingRight = true; position = new Vector2(); _Rigibody2D = GetComponent <Rigidbody2D>(); jumpsRemaining = TotalJumpsAllowed; _PhotonView = GetComponent <PhotonView>(); _PhotonTransform = GetComponent <PhotonTransformView>(); AttackObjs = new GameObject[3]; AttackObjs[0] = transform.GetChild(3).gameObject; AttackObjs[1] = transform.GetChild(1).gameObject; AttackObjs[2] = transform.GetChild(2).gameObject; _MobileInput = GameObject.FindGameObjectWithTag("MobileController").GetComponent <MobileController>(); spawnPause = 0.5f; spawnPauseWait = new WaitForSeconds(spawnPause); lastHitBy = -1; lastHitTime = Time.time; lastHitForgetLength = 5;//Seconds if (_PhotonView.isMine) { tag = "PlayerSelf"; _PhotonView.RPC("SetSlotNum", PhotonTargets.All, NetIDs.PlayerNumber(PhotonNetwork.player.ID)); CamManager.SetTarget(transform); } }
// Start is called before the first frame update void Start() { currentHealth = healthSize; characterController = GetComponent <CharacterController>(); mobileController = GameObject.FindGameObjectWithTag("Joystick").GetComponent <MobileController>(); animator = GetComponent <Animator>(); if (PlayerPrefs.HasKey("coinsFinal")) { coinsCount = PlayerPrefs.GetInt("coinsFinal"); } else { coinsCount = 0; } coins.text = "Coins: " + coinsCount.ToString(); }
public void StudentLevelQuiz() { key = 0; quote = ""; MobileController.SetActive(false); LockKeyParent.SetActive(false); LockKeyCount.SetActive(false); KeyLockContainer.SetActive(true); key = Random.Range(0, 11); quote = Lessons [key].GetComponentInChildren <Text>().text; keyQuote.text = "\" " + quote + " \""; Debug.Log(key); Debug.Log(quote); Debug.Log(randomList.IndexOf(key)); }
// Start is called before the first frame update void Awake() { // Set up level stuff. //Enemy spawn Level = GameObject.Find("Level"); EnemyRightSpawn = Level.transform.Find("Platforms").transform.Find("Right").transform.Find("EnemySpawn"); EnemyMiddleSpawn = Level.transform.Find("Platforms").transform.Find("Middle").transform.Find("EnemySpawn"); EnemyLeftSpawn = Level.transform.Find("Platforms").transform.Find("Left").transform.Find("EnemySpawn"); //Player move positions PlayerPosRight = Level.transform.Find("Platforms").transform.Find("Right").transform.Find("PlayerPosition"); PlayerPosMiddle = Level.transform.Find("Platforms").transform.Find("Middle").transform.Find("PlayerPosition"); PlayerPosLeft = Level.transform.Find("Platforms").transform.Find("Left").transform.Find("PlayerPosition"); //Setup Player player = GameObject.Find("Player").GetComponent <Player>(); // get player positions. player.RightPosition = PlayerPosRight; player.MiddlePosition = PlayerPosMiddle; player.LeftPosition = PlayerPosLeft; //assign current level platforms rightPlatform = Level.transform.Find("Platforms").transform.Find("Right").transform.Find("RightPlatform").GetComponent <Platform>(); leftPlatform = Level.transform.Find("Platforms").transform.Find("Left").transform.Find("LeftPlatform").GetComponent <Platform>(); middlePlatform = Level.transform.Find("Platforms").transform.Find("Middle").transform.Find("MiddlePlatform").GetComponent <Platform>(); //Get Portals leftPortal = Level.transform.Find("Platforms").transform.Find("Left").transform.Find("Portal").GetComponent <Portal>(); middlePortal = Level.transform.Find("Platforms").transform.Find("Middle").transform.Find("Portal").GetComponent <Portal>(); rightPortal = Level.transform.Find("Platforms").transform.Find("Right").transform.Find("Portal").GetComponent <Portal>(); // get Level Generation script levelGeneration = GetComponent <LevelGeneration>(); //Get slam detection from player gameobject slamDetection = GameObject.Find("Player").GetComponent <SlamDetection>(); spawnEnemiesHelper = GetComponent <SpawnEnemiesHelper>(); spawnEnemiesHelper.pauseEnemySpawning = true; mobileController = GameObject.Find("MobileController").GetComponent <MobileController>(); }
public void Cannot_Retrieve_Image_Data_For_Invalid_ID() { Mock <IMobileRepository> mock = new Mock <IMobileRepository>(); mock.Setup(m => m.Mobiles).Returns(new List <Mobile> { new Mobile { MobileId = 1, Name = "Mobile1" }, new Mobile { MobileId = 2, Name = "Mobile2" } }.AsQueryable()); MobileController controller = new MobileController(mock.Object); ActionResult result = controller.GetImage(10); Assert.IsNull(result); }
public void EntreprenuerLevelQuiz() { key = 0; quote = ""; MobileController.SetActive(false); LockKeyParent.SetActive(false); LockKeyCount.SetActive(false); KeyLockContainer.SetActive(true); key = Random.Range(0, 11); quote = levelThree[key].ToLower(); quoteImageEnt.GetComponent <Image>().sprite = quoteImageGroupEnt[key]; keyQuote.text = "\" " + quote + " \""; Debug.Log(key); Debug.Log(quote); Debug.Log(randomList.IndexOf(key)); }
void Awake() { anim = GetComponentInChildren <Animator>(); moveRight = 0; moveLeft = 0; controlsPaused = false; myAudioSrc = GetComponent <AudioSource>(); myAudioSrc.clip = DeathNoise; punching = false; deathColor = Color.clear; lifeColor = Color.white; isDead = false; StrengthsList = GameObject.FindGameObjectWithTag("Master"). GetComponent <Master>().GetStrengthList(); CBUG.Log("" + (StrengthsList == null ? "True" : "False")); jumpForceTemp = 0f; SpeedTemp = 0f; attackDisableDelay = new WaitForSeconds(AttackLife); facingRight = true; position = new Vector2(); _Rigibody2D = GetComponent <Rigidbody2D>(); jumpsRemaining = TotalJumpsAllowed; AttackObjs = new GameObject[3]; AttackObjs[0] = transform.GetChild(3).gameObject; AttackObjs[1] = transform.GetChild(1).gameObject; AttackObjs[2] = transform.GetChild(2).gameObject; _MobileInput = GameObject.FindGameObjectWithTag("MobileController").GetComponent <MobileController>(); spawnPause = 0.5f; spawnPauseWait = new WaitForSeconds(spawnPause); lastHitBy = -1; lastHitTime = Time.time; lastHitForgetLength = 5;//Seconds }
static void Main(string[] args) { Product product1 = new Product("12345", "laptop-dell"); MobileController order1 = new MobileController( new DBInventoryService(), new ICICIPaymentService(), new FedExShippingService()); order1.orderProduct( product1, 120, 2345, 112, new Address("1-1", "", "", "")); Product product2 = new Product("12346", "mobile-oppo"); DesktopController order2 = new DesktopController( new DBInventoryService(), new PayPalPaymentService(), new FedExShippingService()); order2.orderProduct(product2, 120, 2341, 111, new Address("1-2", "", "", "")); }
public void Can_Send_Pagination_View_Model() { Mock <IMobileRepository> mock = new Mock <IMobileRepository>(); mock.Setup(m => m.Mobiles).Returns(new List <Mobile> { new Mobile { MobileId = 1, Name = "Mobile1" }, new Mobile { MobileId = 2, Name = "Mobile2" }, new Mobile { MobileId = 3, Name = "Mobile3" }, new Mobile { MobileId = 4, Name = "Mobile4" }, new Mobile { MobileId = 5, Name = "Mobile5" } }); MobileController controller = new MobileController(mock.Object); controller.pageSize = 3; // Act MobilesListViewModel result = (MobilesListViewModel)controller.List(null, 2).Model; // Assert PagingInfo pageInfo = result.PagingInfo; Assert.AreEqual(pageInfo.CurrentPage, 2); Assert.AreEqual(pageInfo.ItemsPerPage, 3); Assert.AreEqual(pageInfo.TotalItems, 5); Assert.AreEqual(pageInfo.TotalPages, 2); }
public void Generate_Category_Specific_Game_Count() { Mock <IMobileRepository> mock = new Mock <IMobileRepository>(); mock.Setup(m => m.Mobiles).Returns(new List <Mobile> { new Mobile { MobileId = 1, Name = "Mobile1", Category = "Cat1" }, new Mobile { MobileId = 2, Name = "Mobile2", Category = "Cat2" }, new Mobile { MobileId = 3, Name = "Mobile3", Category = "Cat1" }, new Mobile { MobileId = 4, Name = "Mobile4", Category = "Cat2" }, new Mobile { MobileId = 5, Name = "Mobile5", Category = "Cat3" } }); MobileController controller = new MobileController(mock.Object); controller.pageSize = 3; int res1 = ((MobilesListViewModel)controller.List("Cat1").Model).PagingInfo.TotalItems; int res2 = ((MobilesListViewModel)controller.List("Cat2").Model).PagingInfo.TotalItems; int res3 = ((MobilesListViewModel)controller.List("Cat3").Model).PagingInfo.TotalItems; int resAll = ((MobilesListViewModel)controller.List(null).Model).PagingInfo.TotalItems; Assert.AreEqual(res1, 2); Assert.AreEqual(res2, 2); Assert.AreEqual(res3, 1); Assert.AreEqual(resAll, 5); }
// Start is called before the first frame update private void Start() { animator = GetComponent <Animator>(); mContr = GameObject.Find("JoystickBG").GetComponent <MobileController>(); }
public MobiileControllerTest() { _MobileService = new MobileService(); _MobiileController = new MobileController(_MobileService); }
void Start() { kalancanScript = kalanCanText.GetComponent <KalanCanController>(); mobileScript = spaceButton.GetComponent <MobileController>(); zRotateScript = zRotateCont.GetComponent <zRotateController>(); }
void Start() { characterController = GetComponent <CharacterController>(); mobileController = GameObject.FindGameObjectWithTag("Joystick").GetComponent <MobileController>(); }
void Start() { mContr = GameObject.FindWithTag("Joystick").GetComponent <MobileController>(); }
private void Start() { player_controller = GetComponent <CharacterController>(); mContr = GameObject.FindGameObjectWithTag("Joystick").GetComponent <MobileController>(); }
// finds the corresponding visual wheel // correctly applies the transform private void Start() { mCont = GameObject.FindGameObjectWithTag("Joy").GetComponent <MobileController>(); gameObject.GetComponent <Rigidbody>().centerOfMass.Set(0, -0.02f, 0); }
void Start() { ch_controller = GetComponent <CharacterController>(); _rotator = GetComponent <Transform>(); mContr = GameObject.FindGameObjectWithTag("Joystick").GetComponent <MobileController>(); }