New Version 1.42

Moving cam replay.
Fixed the bugs.

New Version 1.42

Moving cam replay.
Fixed the bugs.

New Version 1.42

Moving cam replay,
Fixed the bugs.
This commit is contained in:
SkunkStudios 2025-01-29 09:54:37 +07:00
parent dcb7df5fd1
commit 1c033119df
7079 changed files with 186851 additions and 48991 deletions

View file

@ -0,0 +1,3 @@
{
"createSeparatePackage": false
}

View file

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 931f3395378214a6c94333853bd0659b
folderAsset: yes
timeCreated: 1489179043
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b6295675042094715ad9cc104210aeb7
folderAsset: yes
timeCreated: 1489733951
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,48 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void AchievementStep_StepIndexTest(
[Values(-1, 0, 1)] int stepIndex
)
{
var achievementId = "unit_tester";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AchievementStep(stepIndex, achievementId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AchievementStep_AchievementIdTest(
[Values("unit_tester", "", null)] string achievementId
)
{
var stepIndex = 0;
if (string.IsNullOrEmpty(achievementId))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.AchievementStep(stepIndex, achievementId));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AchievementStep(stepIndex, achievementId));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void AchievementStep_CustomDataTest()
{
var stepIndex = 0;
var achievementId = "unit_tester";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AchievementStep(stepIndex, achievementId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a592d27ead6884163839d4f8da3977ef
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,34 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void AchievementUnlocked_AchievementIdTest(
[Values("unit_tester", "", null)] string achievementId
)
{
if (string.IsNullOrEmpty(achievementId))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.AchievementUnlocked(achievementId));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AchievementUnlocked(achievementId));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void AchievementUnlocked_CustomDataTest()
{
var achievementId = "unit_tester";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AchievementUnlocked(achievementId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d1114812d620342e1a4ad3eaae7e220c
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,62 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void AdComplete_RewardedTest(
[Values(true, false)] bool rewarded
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdComplete(rewarded));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdComplete_NetworkStringTest(
[Values("unityads", "", null)] string network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdComplete(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdComplete_NetworkEnumTest(
[Values(AdvertisingNetwork.UnityAds, AdvertisingNetwork.None)] AdvertisingNetwork network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdComplete(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdComplete_PlacementIdTest(
[Values("rewardedVideo", "", null)] string placementId
)
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdComplete(rewarded, network, placementId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdComplete_CustomDataTest()
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
var placementId = "rewardedVideo";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdComplete(rewarded, network, placementId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9405b416c158444b19157040fd664533
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,62 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void AdOffer_RewardedTest(
[Values(true, false)] bool rewarded
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdOffer(rewarded));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdOffer_NetworkStringTest(
[Values("unityads", "", null)] string network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdOffer(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdOffer_NetworkEnumTest(
[Values(AdvertisingNetwork.UnityAds, AdvertisingNetwork.None)] AdvertisingNetwork network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdOffer(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdOffer_PlacementIdTest(
[Values("rewardedVideo", "", null)] string placementId
)
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdOffer(rewarded, network, placementId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdOffer_CustomDataTest()
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
var placementId = "rewardedVideo";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdOffer(rewarded, network, placementId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 96626a3e271e94e76a848c68828fbbac
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,62 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void AdSkip_RewardedTest(
[Values(true, false)] bool rewarded
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdSkip(rewarded));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdSkip_NetworkStringTest(
[Values("unityads", "", null)] string network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdSkip(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdSkip_NetworkEnumTest(
[Values(AdvertisingNetwork.UnityAds, AdvertisingNetwork.None)] AdvertisingNetwork network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdSkip(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdSkip_PlacementIdTest(
[Values("rewardedVideo", "", null)] string placementId
)
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdSkip(rewarded, network, placementId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdSkip_CustomDataTest()
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
var placementId = "rewardedVideo";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdSkip(rewarded, network, placementId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c09652e660b34484cb10d35ed2206df5
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,62 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void AdStart_RewardedTest(
[Values(true, false)] bool rewarded
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdStart(rewarded));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdStart_NetworkStringTest(
[Values("unityads", "", null)] string network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdStart(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdStart_NetworkEnumTest(
[Values(AdvertisingNetwork.UnityAds, AdvertisingNetwork.None)] AdvertisingNetwork network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdStart(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdStart_PlacementIdTest(
[Values("rewardedVideo", "", null)] string placementId
)
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdStart(rewarded, network, placementId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void AdStart_CustomDataTest()
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
var placementId = "rewardedVideo";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.AdStart(rewarded, network, placementId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 589b3ddef1e4d44cea68e0144bd95434
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,115 @@
#pragma warning disable 0612, 0618
using System;
using System.Collections.Generic;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
[TestFixture, Category("Standard Event SDK")]
public partial class AnalyticsEventTests
{
readonly Dictionary<string, object> m_CustomData = new Dictionary<string, object>();
AnalyticsResult m_Result = AnalyticsResult.Ok;
[SetUp]
public void TestCaseSetUp()
{
m_Result = AnalyticsResult.Ok;
m_CustomData.Clear();
m_CustomData.Add("custom_param", "test");
}
[Test]
public void SdkVersion_FormatTest()
{
int major, minor, patch;
var versions = AnalyticsEvent.sdkVersion.Split('.');
Assert.AreEqual(3, versions.Length, "Number of integer fields in version format");
Assert.IsTrue(int.TryParse(versions[0], out major), "Major version is an integer");
Assert.IsTrue(int.TryParse(versions[1], out minor), "Minor version is an integer");
Assert.IsTrue(int.TryParse(versions[2], out patch), "Patch version is an integer");
Assert.LessOrEqual(0, major, "Major version");
Assert.LessOrEqual(0, minor, "Minor version");
Assert.LessOrEqual(0, patch, "Patch version");
}
[Test]
public void Custom_EventNameTest(
[Values("custom_event", "", null)] string eventName
)
{
if (string.IsNullOrEmpty(eventName))
{
Assert.Throws<ArgumentException>(() => m_Result = AnalyticsEvent.Custom(eventName));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.Custom(eventName));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void Custom_EventDataTest()
{
var eventName = "custom_event";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.Custom(eventName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void Custom_RegisterUnregisterUnnamedTest()
{
Action<IDictionary<string, object>> myAction =
eventData => eventData.Add("my_key", "my_value");
AnalyticsEvent.Register(myAction); // Registering for a named AnalyticsEvent
var eventName = "custom_event";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.Custom(eventName, m_CustomData));
EvaluateRegisteredCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
AnalyticsEvent.Unregister(myAction);
}
/// Normal. Unregistered.
public static void EvaluateCustomData(IDictionary<string, object> customData)
{
Assert.AreEqual(1, customData.Count, "Custom param count");
}
/// For Registered case.
public static void EvaluateRegisteredCustomData(IDictionary<string, object> customData)
{
Assert.AreEqual(2, customData.Count, "Custom param count");
}
public static void EvaluateAnalyticsResult(AnalyticsResult result)
{
switch (result)
{
case AnalyticsResult.Ok:
break;
case AnalyticsResult.InvalidData:
Assert.Fail("Event data is invalid.");
break;
case AnalyticsResult.TooManyItems:
Assert.Fail("Event data consists of too many parameters.");
break;
default:
Debug.LogFormat("A result of {0} is passable for the purpose of this test.", result);
break;
}
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b5366b8adc0f44b3c9cb261a3f752d7a
timeCreated: 1492730660
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,22 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void ChatMessageSent_NoArgsTest()
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ChatMessageSent());
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ChatMessageSent_CustomDataTest()
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ChatMessageSent(m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 7b186a0d29a784d81809e8a5471d155e
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,34 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void CutsceneSkip_CutsceneNameTest(
[Values("test_cutscene", "", null)] string name
)
{
if (string.IsNullOrEmpty(name))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.CutsceneSkip(name));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.CutsceneSkip(name));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void CutsceneSkip_CustomDataTest()
{
var name = "test_cutscene";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.CutsceneSkip(name, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f03b3e03b69e74ef9bd0f20377217a73
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,34 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void CutsceneStart_CutsceneNameTest(
[Values("test_cutscene", "", null)] string name
)
{
if (string.IsNullOrEmpty(name))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.CutsceneStart(name));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.CutsceneStart(name));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void CutsceneStart_CustomDataTest()
{
var name = "test_cutscene";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.CutsceneStart(name, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: edf97aac6cc5a437ebf600a06a2e5ac7
timeCreated: 1492896816
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,33 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void FirstInteraction_NoArgsTest()
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.FirstInteraction());
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void FirstInteraction_ActionIdTest(
[Values("test_user_action", "", null)] string actionId
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.FirstInteraction(actionId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void FirstInteraction_CustomDataTest()
{
var actionId = "test_user_action";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.FirstInteraction(actionId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 78759e25237a7430587982cd92a2a0d8
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,58 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void GameOver_NoArgsTest()
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.GameOver());
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void GameOver_LevelIndexTest(
[Values(-1, 0, 1)] int levelIndex
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.GameOver(levelIndex));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void GameOver_LevelNameTest(
[Values("test_level", "", null)] string levelName
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.GameOver(levelName));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void GameOver_LevelIndex_LevelNameTest(
[Values(0)] int levelIndex,
[Values("test_level", "", null)] string levelName
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.GameOver(levelIndex, levelName));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void GameOver_CustomDataTest()
{
var levelIndex = 0;
var levelName = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.GameOver(levelName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.GameOver(levelIndex, levelName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a30e59ca9f68d46db88323ac18f49e31
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,22 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void GameStart_NoArgsTest()
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.GameStart());
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void GameStart_CustomDataTest()
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.GameStart(m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2b2be9ee9f41a4b2db6b502697ba31b1
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,111 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void IAPTransaction_ContextTest(
[Values("test", "", null)] string context)
{
var price = 1f;
var itemId = "test_item";
if (string.IsNullOrEmpty(context))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.IAPTransaction(context, price, itemId));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.IAPTransaction(context, price, itemId));
}
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void IAPTransaction_PriceTest(
[Values(-1f, 0f, 1f)] float price)
{
var context = "test";
var itemId = "test_item";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.IAPTransaction(context, price, itemId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void IAPTransaction_ItemIdTest(
[Values("test_item", "", null)] string itemId)
{
var context = "test";
var price = 1f;
if (string.IsNullOrEmpty(itemId))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.IAPTransaction(context, price, itemId));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.IAPTransaction(context, price, itemId));
}
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void IAPTransaction_ItemTypeTest(
[Values("test_type", "", null)] string itemType)
{
var context = "test";
var price = 1f;
var itemId = "test_item";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.IAPTransaction(context, price, itemId, itemType));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void IAPTransaction_LevelTest(
[Values("test_level", "", null)] string level)
{
var context = "test";
var price = 1f;
var itemId = "test_item";
var itemType = "test_type";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.IAPTransaction(context, price, itemId, itemType, level));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void IAPTransaction_TransactionIdTest(
[Values("test_id", "", null)] string transactionId)
{
var context = "test";
var price = 1f;
var itemId = "test_item";
var itemType = "test_type";
var level = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.IAPTransaction(context, price, itemId, itemType, level, transactionId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void IAPTransaction_CustomDataTest()
{
var context = "test";
var price = 1f;
var itemId = "test_item";
var itemType = "test_type";
var level = "test_level";
var transactionId = "test_id";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.IAPTransaction(context, price, itemId, itemType, level, transactionId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8b4a8234f532f4b34aba0ab70400d90d
timeCreated: 1497539738
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,176 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void ItemAcquired_CurrencyTypeTest(
[Values(AcquisitionType.Premium, AcquisitionType.Soft)] AcquisitionType currencyType)
{
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemAcquired_ContextTest(
[Values("test", "", null)] string context)
{
var currencyType = AcquisitionType.Soft;
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
if (string.IsNullOrEmpty(context))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId));
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void ItemAcquired_AmountTest(
[Values(-1f, 0f, 1f)] float amount)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var itemId = "test_item";
var balance = 1f;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemAcquired_ItemIdTest(
[Values("test_item", "", null)] string itemId)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var balance = 1f;
if (string.IsNullOrEmpty(itemId))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId));
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void ItemAcquired_BalanceTest(
[Values(-1f, 0, 1f)] float balance)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemAcquired_ItemTypeTest(
[Values("test_type", "", null)] string itemType)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, itemType));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance, itemType));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemAcquired_LevelTest(
[Values("test_level", "", null)] string level)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
var itemType = "test_type";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, itemType, level));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance, itemType, level));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemAcquired_TransactionIdTest(
[Values("test_id", "", null)] string transactionId)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
var itemType = "test_type";
var level = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, itemType, level, transactionId));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance, itemType, level, transactionId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemAcquired_CustomDataTest()
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
var itemType = "test_type";
var level = "test_level";
var transactionId = "test_id";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, itemType, level, transactionId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemAcquired(currencyType, context, amount, itemId, balance, itemType, level, transactionId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5e7a49a6952af4d4ab2c3b038be68141
timeCreated: 1497539770
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,176 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void ItemSpent_CurrencyTypeTest(
[Values(AcquisitionType.Premium, AcquisitionType.Soft)] AcquisitionType currencyType)
{
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemSpent_ContextTest(
[Values("test", "", null)] string context)
{
var currencyType = AcquisitionType.Soft;
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
if (string.IsNullOrEmpty(context))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId));
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void ItemSpent_AmountTest(
[Values(-1f, 0f, 1f)] float amount)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var itemId = "test_item";
var balance = 1f;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemSpent_ItemIdTest(
[Values("test_item", "", null)] string itemId)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var balance = 1f;
if (string.IsNullOrEmpty(itemId))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId));
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void ItemSpent_BalanceTest(
[Values(-1f, 0, 1f)] float balance)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemSpent_ItemTypeTest(
[Values("test_type", "", null)] string itemType)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, itemType));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance, itemType));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemSpent_LevelTest(
[Values("test_level", "", null)] string level)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
var itemType = "test_type";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, itemType, level));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance, itemType, level));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemSpent_TransactionIdTest(
[Values("test_id", "", null)] string transactionId)
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
var itemType = "test_type";
var level = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, itemType, level, transactionId));
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance, itemType, level, transactionId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ItemSpent_CustomDataTest()
{
var currencyType = AcquisitionType.Soft;
var context = "test";
var amount = 1f;
var itemId = "test_item";
var balance = 1f;
var itemType = "test_type";
var level = "test_level";
var transactionId = "test_id";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, itemType, level, transactionId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ItemSpent(currencyType, context, amount, itemId, balance, itemType, level, transactionId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 00ed25e3298ac440eb327c706a964e3a
timeCreated: 1497539780
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,58 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void LevelComplete_LevelIndexTest(
[Values(-1, 0, 1)] int levelIndex
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelComplete(levelIndex));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void LevelComplete_LevelNameTest(
[Values("test_level", "", null)] string levelName
)
{
if (string.IsNullOrEmpty(levelName))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.LevelComplete(levelName));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelComplete(levelName));
EvaluateAnalyticsResult(m_Result);
}
}
// [Test]
// public void LevelComplete_LevelIndex_LevelNameTest (
// [Values(0)] int levelIndex,
// [Values("test_level", "", null)] string levelName
// )
// {
// Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelComplete(levelIndex, levelName));
// EvaluateAnalyticsResult(m_Result);
// }
[Test]
public void LevelComplete_CustomDataTest()
{
var levelIndex = 0;
var levelName = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelComplete(levelName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelComplete(levelIndex, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: fa4ff09b6aaaa4df29a884efa38bce56
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,58 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void LevelFail_LevelIndexTest(
[Values(-1, 0, 1)] int levelIndex
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelFail(levelIndex));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void LevelFail_LevelNameTest(
[Values("test_level", "", null)] string levelName
)
{
if (string.IsNullOrEmpty(levelName))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.LevelFail(levelName));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelFail(levelName));
EvaluateAnalyticsResult(m_Result);
}
}
// [Test]
// public void LevelFail_LevelIndex_LevelNameTest (
// [Values(-1, 0, 1)] int levelIndex,
// [Values("test_level", "", null)] string levelName
// )
// {
// Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelFail(levelIndex, levelName));
// EvaluateAnalyticsResult(m_Result);
// }
[Test]
public void LevelFail_CustomDataTest()
{
var levelIndex = 0;
var levelName = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelFail(levelName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelFail(levelIndex, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 036d03e26977243fa9a2d7af48e51e08
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,58 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void LevelQuit_LevelIndexTest(
[Values(-1, 0, 1)] int levelIndex
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelQuit(levelIndex));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void LevelQuit_LevelNameTest(
[Values("test_level", "", null)] string levelName
)
{
if (string.IsNullOrEmpty(levelName))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.LevelQuit(levelName));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelQuit(levelName));
EvaluateAnalyticsResult(m_Result);
}
}
// [Test]
// public void LevelQuit_LevelIndex_LevelNameTest (
// [Values(-1, 0, 1)] int levelIndex,
// [Values("test_level", "", null)] string levelName
// )
// {
// Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelQuit(levelIndex, levelName));
// EvaluateAnalyticsResult(m_Result);
// }
[Test]
public void LevelQuit_CustomDataTest()
{
var levelIndex = 0;
var levelName = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelQuit(levelName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelQuit(levelIndex, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 617202f4e2bed4ef8acccfd6c1ecd6fa
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,58 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void LevelSkip_LevelIndexTest(
[Values(-1, 0, 1)] int levelIndex
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelSkip(levelIndex));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void LevelSkip_LevelNameTest(
[Values("test_level", "", null)] string levelName
)
{
if (string.IsNullOrEmpty(levelName))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.LevelSkip(levelName));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelSkip(levelName));
EvaluateAnalyticsResult(m_Result);
}
}
// [Test]
// public void LevelSkip_LevelIndex_LevelNameTest (
// [Values(-1, 0, 1)] int levelIndex,
// [Values("test_level", "", null)] string levelName
// )
// {
// Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelSkip(levelIndex, levelName));
// EvaluateAnalyticsResult(m_Result);
// }
[Test]
public void LevelSkip_CustomDataTest()
{
var levelIndex = 0;
var levelName = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelSkip(levelName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelSkip(levelIndex, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 93f7ca1a9c5c945a89e884f9611c70f0
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,58 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void LevelStart_LevelIndexTest(
[Values(-1, 0, 1)] int levelIndex
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelStart(levelIndex));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void LevelStart_LevelNameTest(
[Values("test_level", "", null)] string levelName
)
{
if (string.IsNullOrEmpty(levelName))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.LevelStart(levelName));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelStart(levelName));
EvaluateAnalyticsResult(m_Result);
}
}
// [Test]
// public void LevelStart_LevelIndex_LevelNameTest (
// [Values(0)] int levelIndex,
// [Values("test_level", "", null)] string levelName
// )
// {
// Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelStart(levelIndex, levelName));
// EvaluateAnalyticsResult(m_Result);
// }
[Test]
public void LevelStart_CustomDataTest()
{
var levelIndex = 0;
var levelName = "test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelStart(levelName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelStart(levelIndex, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 876d47a520ae34f81a97792e1afed14b
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,58 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void LevelUp_LevelIndexTest(
[Values(0, 1, 2)] int newLevelIndex
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelUp(newLevelIndex));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void LevelUp_LevelNameTest(
[Values("new_test_level", "", null)] string newLevelName
)
{
if (string.IsNullOrEmpty(newLevelName))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.LevelUp(newLevelName));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelUp(newLevelName));
EvaluateAnalyticsResult(m_Result);
}
}
// [Test]
// public void LevelUp_LevelIndex_LevelNameTest (
// [Values(1)] int newLevelIndex,
// [Values("new_test_level", "", null)] string newLevelName
// )
// {
// Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelUp(newLevelIndex, newLevelName));
// EvaluateAnalyticsResult(m_Result);
// }
[Test]
public void LevelUp_CustomDataTest()
{
var newLevelIndex = 1;
var newLevelName = "new_test_level";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelUp(newLevelName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.LevelUp(newLevelIndex, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b0bb2afc5cd494e6f9b44455a0fc22f8
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,62 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void PostAdAction_RewardedTest(
[Values(true, false)] bool rewarded
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PostAdAction(rewarded));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void PostAdAction_NetworkStringTest(
[Values("unityads", "", null)] string network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PostAdAction(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void PostAdAction_NetworkEnumTest(
[Values(AdvertisingNetwork.UnityAds, AdvertisingNetwork.None)] AdvertisingNetwork network
)
{
var rewarded = true;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PostAdAction(rewarded, network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void PostAdAction_PlacementIdTest(
[Values("rewardedVideo", "", null)] string placementId
)
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PostAdAction(rewarded, network, placementId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void PostAdAction_CustomDataTest()
{
var rewarded = true;
var network = AdvertisingNetwork.UnityAds;
var placementId = "rewardedVideo";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PostAdAction(rewarded, network, placementId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 293182c4d29604c05b6724ae00fd121a
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,34 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void PushNotificationClick_MessageIdTest(
[Values("test_message", "", null)] string messageId
)
{
if (string.IsNullOrEmpty(messageId))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.PushNotificationClick(messageId));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PushNotificationClick(messageId));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void PushNotificationClick_CustomDataTest()
{
var messageId = "test_message";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PushNotificationClick(messageId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 240551e3142f04b0ca801ce8eb645ba2
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,22 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void PushNotificationEnable_NoArgsTest()
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PushNotificationEnable());
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void PushNotificationEnable_CustomDataTest()
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.PushNotificationEnable(m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a10564aae782c458cbf1de024f4870f7
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,43 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void ScreenVisit_ScreenNameStringTest(
[Values("test_screen", "", null)] string screenName
)
{
if (string.IsNullOrEmpty(screenName))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.ScreenVisit(screenName));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ScreenVisit(screenName));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void ScreenVisit_ScreenNameEnumTest(
[Values(ScreenName.CrossPromo, ScreenName.IAPPromo, ScreenName.None)] ScreenName screenName
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ScreenVisit(screenName));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void ScreenVisit_CustomDataTest()
{
var screenName = ScreenName.MainMenu;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.ScreenVisit(screenName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 768d77435df35443bad74aedc993c0cf
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,110 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void SocialShareAccept_ShareTypeStringTest(
[Values("test_share", "", null)] string shareType
)
{
var socialNetwork = SocialNetwork.Facebook;
if (string.IsNullOrEmpty(shareType))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.SocialShare(shareType, socialNetwork));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.SocialShareAccept(shareType, socialNetwork));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void SocialShareAccept_ShareTypeEnumTest(
[Values(ShareType.TextOnly, ShareType.Image, ShareType.None)] ShareType shareType
)
{
var socialNetwork = SocialNetwork.Twitter;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.SocialShareAccept(shareType, socialNetwork));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void SocialShareAccept_SocialNetworkStringTest(
[Values("test_network", "", null)] string socialNetwork
)
{
var shareType = ShareType.Image;
if (string.IsNullOrEmpty(socialNetwork))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.SocialShare(shareType, socialNetwork));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.SocialShareAccept(shareType, socialNetwork));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void SocialShareAccept_SocialNetworkEnumTest(
[Values(SocialNetwork.GooglePlus, SocialNetwork.OK_ru, SocialNetwork.None)] SocialNetwork socialNetwork
)
{
var shareType = ShareType.Video;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.SocialShareAccept(shareType, socialNetwork));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void SocialShareAccept_SenderIdTest(
[Values("test_sender", "", null)] string senderId
)
{
var shareType = ShareType.TextOnly;
var socialNetwork = SocialNetwork.Twitter;
Assert.DoesNotThrow(
() => m_Result = AnalyticsEvent.SocialShareAccept(shareType, socialNetwork, senderId)
);
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void SocialShareAccept_RecipientIdTest(
[Values("test_recipient", "", null)] string recipientId
)
{
var shareType = ShareType.TextOnly;
var socialNetwork = SocialNetwork.Twitter;
var senderId = "test_sender";
Assert.DoesNotThrow(
() => m_Result = AnalyticsEvent.SocialShareAccept(shareType, socialNetwork, senderId, recipientId)
);
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void SocialShareAccept_CustomDataTest()
{
var shareType = ShareType.TextOnly;
var socialNetwork = SocialNetwork.Twitter;
var senderId = "test_sender";
var recipientId = "test_recipient";
Assert.DoesNotThrow(
() => m_Result = AnalyticsEvent.SocialShareAccept(shareType, socialNetwork, senderId, recipientId, m_CustomData)
);
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 138961c4434d141a987d96df1f8d7342
timeCreated: 1492896446
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,110 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void SocialShare_ShareTypeStringTest(
[Values("test_share", "", null)] string shareType
)
{
var socialNetwork = SocialNetwork.Facebook;
if (string.IsNullOrEmpty(shareType))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.SocialShare(shareType, socialNetwork));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.SocialShare(shareType, socialNetwork));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void SocialShare_ShareTypeEnumTest(
[Values(ShareType.TextOnly, ShareType.Image, ShareType.None)] ShareType shareType
)
{
var socialNetwork = SocialNetwork.Twitter;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.SocialShare(shareType, socialNetwork));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void SocialShare_SocialNetworkStringTest(
[Values("test_network", "", null)] string socialNetwork
)
{
var shareType = ShareType.Image;
if (string.IsNullOrEmpty(socialNetwork))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.SocialShare(shareType, socialNetwork));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.SocialShare(shareType, socialNetwork));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void SocialShare_SocialNetworkEnumTest(
[Values(SocialNetwork.GooglePlus, SocialNetwork.OK_ru, SocialNetwork.None)] SocialNetwork socialNetwork
)
{
var shareType = ShareType.Video;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.SocialShare(shareType, socialNetwork));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void SocialShare_SenderIdTest(
[Values("test_sender", "", null)] string senderId
)
{
var shareType = ShareType.TextOnly;
var socialNetwork = SocialNetwork.Twitter;
Assert.DoesNotThrow(
() => m_Result = AnalyticsEvent.SocialShare(shareType, socialNetwork, senderId)
);
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void SocialShare_RecipientIdTest(
[Values("test_recipient", "", null)] string recipientId
)
{
var shareType = ShareType.TextOnly;
var socialNetwork = SocialNetwork.Twitter;
var senderId = "test_sender";
Assert.DoesNotThrow(
() => m_Result = AnalyticsEvent.SocialShare(shareType, socialNetwork, senderId, recipientId)
);
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void SocialShare_CustomDataTest()
{
var shareType = ShareType.TextOnly;
var socialNetwork = SocialNetwork.Twitter;
var senderId = "test_sender";
var recipientId = "test_recipient";
Assert.DoesNotThrow(
() => m_Result = AnalyticsEvent.SocialShare(shareType, socialNetwork, senderId, recipientId, m_CustomData)
);
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 811f7f1f5920641c0a9233503492c9ba
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,75 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void StoreItemClick_StoreTypeTest(
[Values(StoreType.Premium, StoreType.Soft)] StoreType storeType
)
{
var itemId = "test_item";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.StoreItemClick(storeType, itemId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void StoreItemClick_ItemIdTest(
[Values("test_item", "", null)] string itemId
)
{
var storeType = StoreType.Soft;
if (string.IsNullOrEmpty(itemId))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.StoreItemClick(storeType, itemId));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.StoreItemClick(storeType, itemId));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void StoreItemClick_ItemId_ItemNameTest(
[Values("test_item_id", "", null)] string itemId,
[Values("Test Item Name", "", null)] string itemName
)
{
var storeType = StoreType.Soft;
if (string.IsNullOrEmpty(itemId) && string.IsNullOrEmpty(itemName))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.StoreItemClick(storeType, itemId));
}
else
{
if (string.IsNullOrEmpty(itemId))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.StoreItemClick(storeType, itemId));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.StoreItemClick(storeType, itemId, itemName));
EvaluateAnalyticsResult(m_Result);
}
}
}
[Test]
public void StoreItemClick_CustomDataTest()
{
var storeType = StoreType.Soft;
var itemId = "test_item";
var itemName = "Test Item";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.StoreItemClick(storeType, itemId, itemName, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c786248494be6489bbfa006bdf59c773
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,27 @@
using System.Collections.Generic;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void StoreOpened_StoreTypeTest(
[Values(StoreType.Premium, StoreType.Soft)] StoreType storeType
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.StoreOpened(storeType));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void StoreOpened_CustomDataTest()
{
var storeType = StoreType.Soft;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.StoreOpened(storeType, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f4c7193663918411c8f78e3cf844cb9e
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,26 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void TutorialComplete_TutorialIdTest(
[Values("test_tutorial", "", null)] string tutorialId
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialComplete(tutorialId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void TutorialComplete_CustomDataTest()
{
var tutorialId = "test_tutorial";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialComplete(tutorialId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b025f6f8a47be46418bcb0ed1050cfb4
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,26 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void TutorialSkip_TutorialIdTest(
[Values("test_tutorial", "", null)] string tutorialId
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialSkip(tutorialId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void TutorialSkip_CustomDataTest()
{
var tutorialId = "test_tutorial";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialSkip(tutorialId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 3ab6e6972ecb54e2cbd505692415a7ba
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,26 @@
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void TutorialStart_TutorialIdTest(
[Values("test_tutorial", "", null)] string tutorialId
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialStart(tutorialId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void TutorialStart_CustomDataTest()
{
var tutorialId = "test_tutorial";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialStart(tutorialId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2622838afa3284cc882c48ceea4c8220
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,39 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void TutorialStep_StepIndexTest(
[Values(-1, 0, 1)] int stepIndex
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialStep(stepIndex));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void TutorialStep_TutorialIdTest(
[Values("test_tutorial", "", null)] string tutorialId
)
{
var stepIndex = 0;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialStep(stepIndex, tutorialId));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void TutorialStep_CustomDataTest()
{
var stepIndex = 0;
var tutorialId = "test_tutorial";
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.TutorialStep(stepIndex, tutorialId, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a571de1bea3cb4c9784493c6f1b0b76c
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,12 @@
{
"name": "Unity.Analytics.StandardEvents.EditorTests",
"references": [],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false
}

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: adee0c1377ef8b2489060e152dd0d119
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,43 @@
using System;
using NUnit.Framework;
namespace UnityEngine.Analytics.Tests
{
public partial class AnalyticsEventTests
{
[Test]
public void UserSignup_AuthorizationNetworkStringTest(
[Values("test_network", "", null)] string network
)
{
if (string.IsNullOrEmpty(network))
{
Assert.Throws<ArgumentException>(() => AnalyticsEvent.UserSignup(network));
}
else
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.UserSignup(network));
EvaluateAnalyticsResult(m_Result);
}
}
[Test]
public void UserSignup_AuthorizationNetworkEnumTest(
[Values(AuthorizationNetwork.Facebook, AuthorizationNetwork.GameCenter, AuthorizationNetwork.None)] AuthorizationNetwork network
)
{
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.UserSignup(network));
EvaluateAnalyticsResult(m_Result);
}
[Test]
public void UserSignup_CustomDataTest()
{
var network = AuthorizationNetwork.Internal;
Assert.DoesNotThrow(() => m_Result = AnalyticsEvent.UserSignup(network, m_CustomData));
EvaluateCustomData(m_CustomData);
EvaluateAnalyticsResult(m_Result);
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 8b0f0c8689876421c90e7b60f096325a
timeCreated: 1489734081
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4f5362359d4548b44a34a45f19efb4bf
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f2233ba26b028cc4b9e58681e7a22dac
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,24 @@
using System;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Analytics;
public class JsonSerialization
{
// This test was create to verifiy JsonUtility could properly deserialize the nested
// structs used for opt-out status. That process is now handled with remote config so
// now we just verify that the expected response from the token API can be deserialized.
const string kTokenJson = "{" +
"\"url\": \"https://analytics.cloud.unity3d.com/optout?token=24a96770b5c4420a4f930dbb4b72fbb83erfg3edf3ert4r1/\"," +
"\"token\": \"24a96770b5c4420a4f930dbb4b72fbb83erfg3edf3ert4r1\"" +
"}";
[Test]
public void TestTokenStruct_JsonUtility()
{
var tokenData = JsonUtility.FromJson<DataPrivacy.TokenData>(kTokenJson);
Assert.AreEqual("https://analytics.cloud.unity3d.com/optout?token=24a96770b5c4420a4f930dbb4b72fbb83erfg3edf3ert4r1/", tokenData.url);
Assert.AreEqual("24a96770b5c4420a4f930dbb4b72fbb83erfg3edf3ert4r1", tokenData.token);
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0fe4c527c3aa3eb42912a1caafbbc6a0
timeCreated: 1526476500
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,12 @@
{
"name": "Unity.Analytics.DataPrivacy.Tests",
"references": [
"Unity.Analytics.DataPrivacy"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false
}

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 015812e983113a84b95773e55f3cec13
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: