Пример #1
0
        public void AfterTest()
        {
            GameServiceProvider.ClearGameServiceProvider();

            _negativeClip = null;
            _positiveClip = null;

            _species = null;
        }
Пример #2
0
        public void BeforeTest()
        {
            _species = new GameObject().AddComponent <TestSpeciesComponent>();
            _species.gameObject.AddComponent <TestUnityMessageEventDispatcherComponent>().TestAwake();

            _positiveClip = Resources.Load <AudioClip>("Test/Audio/Test_Clip_1");
            _negativeClip = Resources.Load <AudioClip>("Test/Audio/Test_Clip_2");

            _species.SpeciesAudioSource = _species.gameObject.AddComponent <AudioSource>();
            _species.CryClips           = new List <SpeciesComponent.CryAudioClipEntry>
            {
                { new SpeciesComponent.CryAudioClipEntry(ECryType.Positive, _positiveClip) },
                { new SpeciesComponent.CryAudioClipEntry(ECryType.Negative, _negativeClip) }
            };
            Assert.IsNotNull(_species.CryClips[0]);
            Assert.IsNotNull(_species.CryClips[1]);

            new GameObject().AddComponent <TestGameServiceProvider>().TestAwake();

            _wildlife = new MockWildlifeService();
            GameServiceProvider.CurrentInstance.AddService <IWildlifeServiceInterface>(_wildlife);
        }