Exemplo n.º 1
0
        public void SetUp()
        {
            this.view                 = new MockSettingsView();
            this.projectService       = new MockProjectService();
            this.configurationService = new MockConfigurationService();

            this.projectService.GetCurrentProjectReturnValue.AutoSaveInterval = 30;
            this.aspectRatioChangedEvent   = new MockAspectRatioChangedEvent();
            this.smpteTimeCodeChangedEvent = new MockSmtpeTimeCodeChangedEvent();
            this.startTimeCodeChangedEvent = new MockStartTimeCodeChangedEvent();
            this.editModeChangedEvent      = new MockEditModeChangedEvent();
            this.pickThumbnailEvent        = new MockPickThumbnailEvent();
            this.resetWindowsEvent         = new MockResetWindowsEvent();
            this.thumbnailEvent            = new MockThumbnailEvent();
            this.regionManager             = new MockRegionManager();
            this.mainRegion = new MockRegion {
                Name = RegionNames.MainRegion
            };
            this.userSettingsService = new MockUserSettingsService();
            this.persistenceService  = new MockPersistenceService();

            this.regionManager.Regions.Add(this.mainRegion);

            this.eventAggregator = new MockEventAggregator();
            this.eventAggregator.AddMapping <AspectRatioChangedEvent>(this.aspectRatioChangedEvent);
            this.eventAggregator.AddMapping <SmpteTimeCodeChangedEvent>(this.smpteTimeCodeChangedEvent);
            this.eventAggregator.AddMapping <StartTimeCodeChangedEvent>(this.startTimeCodeChangedEvent);
            this.eventAggregator.AddMapping <EditModeChangedEvent>(this.editModeChangedEvent);
            this.eventAggregator.AddMapping <PickThumbnailEvent>(this.pickThumbnailEvent);
            this.eventAggregator.AddMapping <ThumbnailEvent>(this.thumbnailEvent);
            this.eventAggregator.AddMapping <ResetWindowsEvent>(this.resetWindowsEvent);
        }
        public void AfterTest()
        {
            GameServiceProvider.ClearGameServiceProvider();

            _service = null;
            _entity  = null;
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
		public void CanRemoveWorkItemState()
		{
			WorkItem wi = new TestableRootWorkItem();
			MockPersistenceService svc = wi.Services.AddNew<MockPersistenceService, IStatePersistenceService>();

			wi.DeleteState();

			Assert.IsTrue(svc.RemoveCalled);
		}
Exemplo n.º 5
0
		public void LoadMethodSetsWorkItemState()
		{
			WorkItem wi = new TestableRootWorkItem();
			MockPersistenceService svc = wi.Services.AddNew<MockPersistenceService, IStatePersistenceService>();

			wi.Load();

			Assert.AreSame(svc.LoadedState, wi.State);
		}
Exemplo n.º 6
0
		public void LoadMethodCallsPersistenceService()
		{
			WorkItem wi = new TestableRootWorkItem();
			MockPersistenceService svc = wi.Services.AddNew<MockPersistenceService, IStatePersistenceService>();

			wi.Load();

			Assert.IsTrue(svc.LoadCalled);
		}
Exemplo n.º 7
0
		public void SaveMethodCallsPersistenceServiceWithWorkItemState()
		{
			WorkItem wi = new TestableRootWorkItem();
			MockPersistenceService svc = wi.Services.AddNew<MockPersistenceService, IStatePersistenceService>();

			wi.Save();

			Assert.IsTrue(svc.SaveCalled);
			Assert.AreSame(wi.State, svc.SavedState);
		}
 public void BeforeTest()
 {
     _service = new MockPersistenceService
     {
         GetEntitiesResult = new Dictionary <string, IPersistentEntityInterface>
         {
             { "TestKey", new GameObject().AddComponent <MockPersistentEntityComponent>() },
             { "OtherTestKey", new GameObject().AddComponent <MockPersistentEntityComponent>() },
             { "NullTestKey", null }
         }
     };
 }
Exemplo n.º 9
0
		public void SaveMethodResetsHasChangesFlag()
		{
			WorkItem wi = new TestableRootWorkItem();
			MockPersistenceService svc = wi.Services.AddNew<MockPersistenceService, IStatePersistenceService>();
			wi.State["foo"] = "foo";

			Assert.IsTrue(wi.State.HasChanges);

			wi.Save();

			Assert.IsFalse(wi.State.HasChanges);
		}
        public void BeforeTest()
        {
            _entity = new GameObject().AddComponent <TestPersistentEntityComponent>();
            _entity.gameObject.transform.position    = new Vector3(12.0f, 44.0f, 33.0f);
            _entity.gameObject.transform.eulerAngles = new Vector3(33.0f, -12.0f, 2.0f);

            _behaviour      = _entity.gameObject.AddComponent <MockPersistentBehaviourComponent>();
            _otherBehaviour = _entity.gameObject.AddComponent <MockPersistentBehaviourComponent>();

            _service = new MockPersistenceService();

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

            GameServiceProvider.CurrentInstance.AddService <IPersistenceServiceInterface>(_service);
        }
Exemplo n.º 11
0
 public void TestInitialize()
 {
     this.persistenceService  = new MockPersistenceService();
     this.increaseQuotaDialog = new MockIncreasePersistenceQuotaDialog();
 }
Exemplo n.º 12
0
 public void AfterTest()
 {
     _service = null;
 }