コード例 #1
0
        public void BeforeTest()
        {
            _trigger = new GameObject().AddComponent <TestSaveProgressTriggerComponent>();

            var characterObject = new GameObject();

            characterObject.AddComponent <MockActionStateMachineComponent>();
            characterObject.AddComponent <MockInputBinderComponent>();
            characterObject.AddComponent <TestUnityMessageEventDispatcherComponent>().TestAwake();

            _character = characterObject.AddComponent <TestCharacterComponent>();

            _entity    = new GameObject().AddComponent <MockPersistentEntityComponent>();
            _entityKey = "Whatever";

            _service = new MockPersistenceService
            {
                GetEntitiesResult = new Dictionary <string, IPersistentEntityInterface>
                {
                    { _entityKey, _entity }
                }
            };

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

            GameServiceProvider.CurrentInstance.AddService <IPersistenceServiceInterface>(_service);
        }
コード例 #2
0
        public void AfterTest()
        {
            GameServiceProvider.ClearGameServiceProvider();

            _service = null;

            _entity = null;

            _character = null;

            _trigger = null;
        }
コード例 #3
0
        public void AfterTest()
        {
            _entity = null;

            _service = null;
        }
コード例 #4
0
        public void BeforeTest()
        {
            _service = new PersistenceService();

            _entity = new GameObject().AddComponent <MockPersistentEntityComponent>();
        }