| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL; |
| | 4 | | using DCL.Components; |
| | 5 | | using DCL.Controllers; |
| | 6 | | using DCL.Helpers; |
| | 7 | | using Newtonsoft.Json; |
| | 8 | | using NUnit.Framework; |
| | 9 | | using Tests; |
| | 10 | | using UnityEngine; |
| | 11 | | using UnityEngine.TestTools; |
| | 12 | |
|
| | 13 | | public class SceneBoundarieCheckerFeedbackStyleShould : IntegrationTestSuite |
| | 14 | | { |
| | 15 | | protected override PlatformContext CreatePlatformContext() |
| | 16 | | { |
| 1 | 17 | | WebRequestController webRequestController = new WebRequestController(); |
| 1 | 18 | | webRequestController.Initialize( |
| | 19 | | genericWebRequest: new WebRequest(), |
| | 20 | | assetBundleWebRequest: new WebRequestAssetBundle(), |
| | 21 | | textureWebRequest: new WebRequestTexture(), |
| | 22 | | null); |
| | 23 | |
|
| 1 | 24 | | var context = DCL.Tests.PlatformContextFactory.CreateWithCustomMocks |
| | 25 | | ( |
| | 26 | | webRequestController: webRequestController |
| | 27 | | ); |
| | 28 | |
|
| 1 | 29 | | return context; |
| | 30 | | } |
| | 31 | |
|
| | 32 | | protected override WorldRuntimeContext CreateRuntimeContext() |
| | 33 | | { |
| 1 | 34 | | return DCL.Tests.WorldRuntimeContextFactory.CreateWithCustomMocks |
| | 35 | | ( |
| | 36 | | sceneController: new SceneController(), |
| | 37 | | state: new WorldState(), |
| | 38 | | componentFactory: new RuntimeComponentFactory(), |
| | 39 | | sceneBoundsChecker: new SceneBoundsChecker(new SceneBoundsFeedbackStyle_Simple()) |
| | 40 | | ); |
| | 41 | | } |
| | 42 | |
|
| | 43 | | [Test] |
| | 44 | | public void ChangeFeedbackStyleChange() |
| | 45 | | { |
| | 46 | | //Arrange |
| 1 | 47 | | var redFlickerStyle = new SceneBoundsFeedbackStyle_RedFlicker(); |
| | 48 | |
|
| | 49 | | //Act |
| 1 | 50 | | Environment.i.world.sceneBoundsChecker.SetFeedbackStyle(redFlickerStyle); |
| | 51 | |
|
| | 52 | | //Assert |
| 1 | 53 | | Assert.AreSame( Environment.i.world.sceneBoundsChecker.GetFeedbackStyle(), redFlickerStyle ); |
| 1 | 54 | | } |
| | 55 | | } |