private void SubmitResources() { index = 0; if (missionController.CompleteMission(resourceSubmission)) { inventoryController.RemoveResource(resourceSubmission[0]); inventoryController.RemoveResource(resourceSubmission[1]); source.PlayOneShot(source.clip); StopCoroutine("FireTheLaser"); StartCoroutine("FireTheLaser"); } }
public async Task OneAnswer_Success_ThreeStars() { var user = await _userRepository.GetUser("User1Id"); var oldPoints = user.Points; var result = await _controller.CompleteMission("2ddf9168-b030-4b6c-a038-72593e7a75f2", new MissionProof { CreatedText = "Евгений Онегин" }); user = await _userRepository.GetUser("User1Id"); Assert.AreEqual(OperationResultStatus.Success, result.Status); Assert.AreEqual(MissionCompletionStatus.Success, result.MissionCompletionStatus); Assert.AreEqual(3, result.StarsCount); Assert.Greater(user.Points, oldPoints); }
public async Task Show_Yourself_Success() { var user = await _userRepository.GetUser("User1Id"); var oldAvatarUrl = user.AvatarUrl; var oldPoints = user.Points; var result = await _controller.CompleteMission("d061155a-9504-498d-a6e7-bcc20c295cde", new MissionProof { ImageUrls = new List <string> { "imageurl" } }); user = await _userRepository.GetUser("User1Id"); Assert.AreEqual(result.Status, OperationResultStatus.Success); Assert.AreEqual(result.MissionCompletionStatus, MissionCompletionStatus.Success); Assert.AreEqual(oldAvatarUrl, user.AvatarUrl);// avatar is updated separately Assert.Greater(user.Points, oldPoints); }