No Description
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.

ConfigurationTests.cs 2.4KB

1234567891011121314151617181920
  1. using NUnit.Framework;
  2. namespace UnityEngine.Advertisements.Tests
  3. {
  4. public class ConfigurationTests
  5. {
  6. [Test]
  7. [TestCase("{\"enabled\":true,\"coppaCompliant\":true,\"gdprEnabled\":false,\"assetCaching\":\"forced\",\"projectId\":\"a635b135-8caa-4d48-8e2d-f146889f21d5\",\"placements\":[{\"id\":\"video\",\"name\":\"Video\",\"default\":true,\"allowSkip\":true,\"disableBackButton\":true,\"muteVideo\":false,\"useDeviceOrientationForVideo\":false,\"adTypes\":[\"MRAID\",\"VIDEO\",\"DISPLAY\"],\"skipInSeconds\":5,\"skipEndCardOnClose\":false,\"disableVideoControlsFade\":false,\"auctionType\":\"cpm\",\"useCloseIconInsteadOfSkipIcon\":false,\"banner\":{\"refreshRate\":30}},{\"id\":\"rewardedVideo\",\"name\":\"Rewarded Video\",\"default\":false,\"allowSkip\":false,\"disableBackButton\":true,\"muteVideo\":false,\"useDeviceOrientationForVideo\":false,\"adTypes\":[\"MRAID\",\"VIDEO\"],\"skipEndCardOnClose\":false,\"disableVideoControlsFade\":false,\"auctionType\":\"cpm\",\"useCloseIconInsteadOfSkipIcon\":false,\"banner\":{\"refreshRate\":30}}],\"organizationId\":\"2473932314656\",\"developerId\":1107051,\"properties\":\"\",\"analytics\":false,\"gamePrivacy\":{\"method\":\"legitimate_interest\"},\"ageGateLimit\":0,\"legalFramework\":\"\",\"abGroup\":0,\"optOutRecorded\":false,\"optOutEnabled\":false,\"token\":\"\",\"country\":\"\",\"gameSessionId\":\"\"}", true, "video", "rewardedVideo", false, TestName = "Basic Config")]
  8. public void TestValidConfiguration(string json, bool enabled, string defaultPlacement, string placementKey, bool placementValue)
  9. {
  10. var configuration = new Configuration(json);
  11. Assert.That(configuration, Is.Not.Null, "Configuration should not be null");
  12. Assert.That(configuration.enabled, Is.EqualTo(enabled), "configuration.enabled was not set properly");
  13. Assert.That(configuration.defaultPlacement, Is.EqualTo(defaultPlacement), "configuration.defaultPlacement was not set properly");
  14. Assert.That(configuration.placements.ContainsKey(placementKey), Is.EqualTo(true), "placementKey was not found in the list of placements");
  15. Assert.That(configuration.placements.ContainsValue(placementValue), Is.EqualTo(true), "placementValue was not found in the list of placements");
  16. Assert.That(configuration.placements[placementKey], Is.EqualTo(placementValue), "configuration.defaultPlacement was not set properly");
  17. }
  18. }
  19. }