You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

  1. using System;
  2. using NUnit.Framework;
  3. namespace UnityEngine.Analytics.Tests
  4. {
  5. public partial class AnalyticsEventTests
  6. {
  7. [Test]
  8. public void AchievementUnlocked_AchievementIdTest(
  9. [Values("unit_tester", "", null)] string achievementId
  10. )
  11. {
  12. if (string.IsNullOrEmpty(achievementId))
  13. {
  14. Assert.Throws<ArgumentException>(() => AnalyticsEvent.AchievementUnlocked(achievementId));
  15. }
  16. else
  17. {
  18. Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AchievementUnlocked(achievementId));
  19. EvaluateAnalyticsResult(m_Result);
  20. }
  21. }
  22. [Test]
  23. public void AchievementUnlocked_CustomDataTest()
  24. {
  25. var achievementId = "unit_tester";
  26. Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AchievementUnlocked(achievementId, m_CustomData));
  27. EvaluateCustomData(m_CustomData);
  28. EvaluateAnalyticsResult(m_Result);
  29. }
  30. }
  31. }