Exemplo n.º 1
0
        public void ConstructingControllerStartsTimelines()
        {
            var checkTimelines  = new Mock <ITimer>();
            var updateTimelines = new Mock <ITimer>();
            var queue           = new Queue <ITimer>();

            queue.Enqueue(checkTimelines.Object);
            queue.Enqueue(updateTimelines.Object);
            SysTimer.Override = queue.Dequeue;

            var timelines  = new Mock <ITimelines>();
            var controller = new TimelineController(timelines.Object);

            controller.StartTimelines();
            checkTimelines.Raise(c => c.Elapsed  += null, EventArgs.Empty);
            updateTimelines.Raise(u => u.Elapsed += null, EventArgs.Empty);

            checkTimelines.VerifySet(c => c.Interval = 100);
            checkTimelines.VerifySet(c => c.Interval = 60000);
            checkTimelines.Verify(c => c.Start());
            timelines.Verify(t => t.HomeTimeline());
            timelines.Verify(t => t.MentionsTimeline());

            updateTimelines.VerifySet(u => u.Interval = 30000);
            updateTimelines.Verify(u => u.Start());
            timelines.Verify(t => t.UpdateTimeStamps());
            Assert.That(controller, Is.Not.Null);
        }
Exemplo n.º 2
0
        public void TimelineController_Put_Test()
        {
            // Arrange
            Mock <ITimelineService> mock = new Mock <ITimelineService>(MockBehavior.Strict);

            mock.Setup(setup => setup.Update(It.IsAny <Timeline>()));
            TimelineController target   = new TimelineController(mock.Object);
            Timeline           timeline = new Timeline()
            {
                Id              = 1,
                BeginDate       = -1,
                EndDate         = -1,
                Title           = "test",
                RootContentItem = null
            };

            // Act
            target.Configuration = new HttpConfiguration();
            target.Validate <Timeline>(timeline);
            IHttpActionResult result = target.Put(timeline);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result is OkResult);
            mock.Verify(verify => verify.Update(It.IsAny <Timeline>()), Times.Once);
        }
        public void ConstructingControllerStartsTimelines()
        {
            var checkTimelines          = new Mock <ITimer>();
            var updateTimelines         = new Mock <ITimer>();
            var friendsBlockedTimelines = new Mock <ITimer>();
            var queue = new Queue <ITimer>();

            queue.Enqueue(checkTimelines.Object);
            queue.Enqueue(updateTimelines.Object);
            SysTimer.ImplementationOverride = queue.Dequeue;

            var timelines  = new Mock <ITimelines>();
            var controller = new TimelineController(timelines.Object);

            controller.StartTimelines();
            checkTimelines.Raise(c => c.Elapsed          += null, EventArgs.Empty);
            updateTimelines.Raise(u => u.Elapsed         += null, EventArgs.Empty);
            friendsBlockedTimelines.Raise(u => u.Elapsed += null, EventArgs.Empty);

            checkTimelines.VerifySet(c => c.Interval = 100);
            checkTimelines.VerifySet(c => c.Interval = 70000);
            checkTimelines.Verify(c => c.Start());
            timelines.Verify(t => t.UpdateHome());
            timelines.Verify(t => t.UpdateMentions());

            updateTimelines.VerifySet(u => u.Interval = 100);
            updateTimelines.VerifySet(u => u.Interval = 30000);
            updateTimelines.Verify(u => u.Start());
            timelines.Verify(t => t.UpdateTimeStamps());

            controller.Should().NotBeNull();
        }
Exemplo n.º 4
0
        public void initialize(StandaloneController standaloneController)
        {
            GUIManager guiManager = standaloneController.GUIManager;

            editorTimelineController = new TimelineController(standaloneController);
            standaloneController.giveGUIsToTimelineController(editorTimelineController);

            editorController = new EditorController(standaloneController, editorTimelineController);
            editorController.ProjectTypes.addInfo(new ZipProjectType(".sl"));
            standaloneController.DocumentController.addDocumentHandler(new SlideshowDocumentHandler(editorController));

            //Prop Mover
            MedicalController medicalController = standaloneController.MedicalController;

            propMover = new SimObjectMover("LectureProps", medicalController.PluginManager.RendererPlugin, medicalController.EventManager, standaloneController.SceneViewController);

            propEditController = new PropEditController(propMover);

            editorUICallback = new LectureUICallback(standaloneController, editorController, propEditController);

            slideshowEditController = new SlideshowEditController(standaloneController, editorUICallback, this.propEditController, editorController, editorTimelineController);
            slideshowExplorer       = new SlideshowExplorer(slideshowEditController);
            guiManager.addManagedDialog(slideshowExplorer);

            TaskController taskController = standaloneController.TaskController;

            taskController.addTask(new MDIDialogOpenTask(slideshowExplorer, "Medical.SlideshowExplorer", "Authoring Tools", "Lecture.Icon.SmartLectureIcon", TaskMenuCategories.Create));

            CommonEditorResources.initialize(standaloneController);
            standaloneController.ViewHostFactory.addFactory(new SlideTaskbarFactory());

            standaloneController.MedicalStateController.StateAdded      += MedicalStateController_StateAdded;
            standaloneController.MedicalStateController.BlendingStopped += MedicalStateController_BlendingStopped;
        }
Exemplo n.º 5
0
        public void CanGetTimeline()
        {
            string uids = "";

            for (int i = 15; i <= 20; i++)
            {
                uids += i.ToString();
                if (i < 20)
                {
                    uids += ",";
                }
            }

            var result = new TimelineController().Get(new TimelineCriteria()
            {
                courseId  = 1,
                grayscale = false,
                timeFrom  = new DateTime(2014, 1, 1),
                timeTo    = new DateTime(2014, 2, 28),
                timeScale = TimeScale.Days,
                timeout   = 3,
                userIds   = uids
            });

            Assert.IsNotNull(result);
            Assert.IsTrue(result.GetType() == typeof(System.Collections.Generic.List <TimelineChartData>));
        }
Exemplo n.º 6
0
        public void TimelineController_GetAll_Test()
        {
            // Arrange
            Mock <ITimelineService> mock = new Mock <ITimelineService>(MockBehavior.Strict);

            mock.Setup(setup => setup.GetAllPublicTimelinesWithoutContentItems()).Returns(new List <Entities.Timeline>()
            {
                new Timeline()
                {
                    Id        = 1,
                    BeginDate = 1000,
                    EndDate   = 1500,
                    Title     = "Test 1"
                },
                new Timeline()
                {
                    Id        = 2,
                    BeginDate = 1555,
                    EndDate   = 1666,
                    Title     = "Test 2"
                }
            });
            TimelineController target = new TimelineController(mock.Object);

            // Act
            IHttpActionResult result = target.Get();

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result is OkNegotiatedContentResult <IEnumerable <Timeline> >);
            Assert.AreEqual(2, ((OkNegotiatedContentResult <IEnumerable <Timeline> >)result).Content.Count());
            mock.Verify(verify => verify.GetAllPublicTimelinesWithoutContentItems(), Times.Once);
        }
        public void ConstructingControllerStartsTimelines()
        {
            var checkTimelines = new Mock<ITimer>();
            var updateTimelines = new Mock<ITimer>();
            var queue = new Queue<ITimer>();
            queue.Enqueue(checkTimelines.Object);
            queue.Enqueue(updateTimelines.Object);
            SysTimer.Override = queue.Dequeue;

            var timelines = new Mock<ITimelines>();
            var controller = new TimelineController(timelines.Object);
            controller.StartTimelines();
            checkTimelines.Raise(c => c.Elapsed += null, EventArgs.Empty);
            updateTimelines.Raise(u => u.Elapsed += null, EventArgs.Empty);

            checkTimelines.VerifySet(c => c.Interval = 100);
            checkTimelines.VerifySet(c => c.Interval = 60000);
            checkTimelines.Verify(c => c.Start());
            timelines.Verify(t => t.HomeTimeline());
            timelines.Verify(t => t.MentionsTimeline());

            updateTimelines.VerifySet(u => u.Interval = 30000);
            updateTimelines.Verify(u => u.Start());
            timelines.Verify(t => t.UpdateTimeStamps());
            Assert.That(controller, Is.Not.Null);
        }
Exemplo n.º 8
0
    void Start()
    {
        this.timelineController = DependencyLocator.getTimelineController();
        this.timerLabel         = this.GetComponent <TextMeshProUGUI>();

        this.timelineController.Events.onTimerChange += this.RenderTimer;
    }
Exemplo n.º 9
0
 void Awake()
 {
     if (TimelineControllerAgent == null)
     {
         TimelineControllerAgent = this;
     }
 }
Exemplo n.º 10
0
        public void TimelineController_Post_Test()
        {
            // Arrange
            Mock <ITimelineService> mock = new Mock <ITimelineService>(MockBehavior.Strict);

            mock.Setup(setup => setup.Add(It.IsAny <Timeline>())).Returns(new Timeline()
            {
                Id = 123
            });
            TimelineController target   = new TimelineController(mock.Object);
            Timeline           timeline = new Timeline()
            {
                BeginDate       = -1,
                EndDate         = -1,
                Title           = "test",
                RootContentItem = null
            };

            // Act
            target.Configuration = new HttpConfiguration();
            target.Validate <Timeline>(timeline);
            IHttpActionResult result = target.Post(timeline);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result is OkNegotiatedContentResult <long>);
            Assert.AreEqual((long)123, (result as OkNegotiatedContentResult <long>).Content);
            mock.Verify(verify => verify.Add(It.IsAny <Timeline>()), Times.Once);
        }
        public TimelineControllerTests()
        {
            this.statusService = Substitute.For <IStatusService>();
            this.userService   = Substitute.For <IUserService>();;
            this.claimsHelper  = Substitute.For <ITwitterClaimsHelper>();

            this.timelineController = new TimelineController(this.statusService, this.userService, this.claimsHelper);
        }
Exemplo n.º 12
0
        public static void CommandHandler(object target, ExecutedRoutedEventArgs ea)
        {
            ea.Handled = true;
            var mainWindow = (MainWindow)Application.Current.MainWindow;
            var tweet      = (Tweet)ea.Parameter ?? mainWindow.Timeline.GetSelectedTweet;
            var link       = TimelineController.TweetLink(tweet);

            OpenLinkCommand.Command.Execute(link, mainWindow);
        }
        public TimelineEditorComponent(MyGUIViewHost viewHost, TimelineEditorView view, SaveableClipboard clipboard)
            : base("Medical.GUI.Editor.TimelineEditor.TimelineEditorComponent.layout", viewHost)
        {
            Widget window = this.widget;

            window.RootKeyChangeFocus += new MyGUIEvent(window_RootKeyChangeFocus);

            this.clipboard          = clipboard;
            this.editorController   = view.EditorController;
            this.propEditController = view.PropEditController;

            this.timelineController = view.TimelineController;
            timelineController.TimelinePlaybackStarted += timelineController_TimelinePlaybackStarted;
            timelineController.TimelinePlaybackStopped += timelineController_TimelinePlaybackStopped;
            timelineController.TimeTicked += timelineController_TimeTicked;

            window.KeyButtonReleased += new MyGUIEvent(window_KeyButtonReleased);

            //Play Button
            playButton = window.findWidget("PlayButton") as Button;
            playButton.MouseButtonClick += new MyGUIEvent(playButton_MouseButtonClick);

            fastForwardButton = window.findWidget("FastForward") as Button;
            fastForwardButton.MouseButtonClick += new MyGUIEvent(fastForwardButton_MouseButtonClick);

            rewindButton = window.findWidget("Rewind") as Button;
            rewindButton.MouseButtonClick += new MyGUIEvent(rewindButton_MouseButtonClick);

            //Timeline view
            ScrollView timelineViewScrollView = window.findWidget("ActionView") as ScrollView;

            timelineView                     = new TimelineView(timelineViewScrollView);
            timelineView.KeyReleased        += new EventHandler <KeyEventArgs>(timelineView_KeyReleased);
            timelineView.ActiveDataChanging += new EventHandler <CancelEventArgs>(timelineView_ActiveDataChanging);
            timelineView.MarkerMoved        += new EventDelegate <TimelineView, float>(timelineView_MarkerMoved);
            timelineView.ActiveDataChanged  += new EventHandler(timelineView_ActiveDataChanged);

            //Track filter
            ScrollView trackFilterScrollView = window.findWidget("ActionFilter") as ScrollView;

            actionFilter = new TrackFilter(trackFilterScrollView, timelineView);
            actionFilter.AddTrackItem += new AddTrackItemCallback(actionFilter_AddTrackItem);

            numberLine = new NumberLine(window.findWidget("NumberLine") as ScrollView, timelineView);

            //Add tracks to timeline.
            buildTrackActions();
            foreach (TimelineActionPrototype action in actionDataManager.Prototypes)
            {
                timelineView.addTrack(action.TypeName);
            }

            //Enabled = false;

            ViewHost.Context.getModel <EditMenuManager>(EditMenuManager.DefaultName).setMenuProvider(this);
        }
        public void DeleteTimelineEvent_Returns404NotFound_WhenNonExistentResourceIDSubmitted()
        {
            mockRepo.Setup(repo => repo.GetTimelineEventById(0)).Returns(() => null);

            var controller = new TimelineController(mockRepo.Object, mapper);

            var result = controller.DeleteTimelineEvent(0);

            Assert.IsType <NotFoundResult>(result);
        }
Exemplo n.º 15
0
        public AnomalousMvcCore(StandaloneController standaloneController, ViewHostFactory viewHostFactory)
        {
            this.standaloneController = standaloneController;
            this.timelineController   = standaloneController.TimelineController;
            timelineController.TimelinePlaybackStopped += new EventHandler(timelineController_TimelinePlaybackStopped);
            this.guiManager      = standaloneController.GUIManager;
            this.viewHostFactory = viewHostFactory;

            viewHostManager = new ViewHostManager(guiManager, viewHostFactory);
        }
        public void GetTimelineEventByID_Returns404NotFound_WhenNonExistentIDProvided()
        {
            mockRepo.Setup(repo => repo.GetTimelineEventById(0)).Returns(() => null);

            var controller = new TimelineController(mockRepo.Object, mapper);

            var result = controller.GetTimelineEventById(1);

            Assert.IsType <NotFoundResult>(result.Result);
        }
        public void GetTimelineEventItems_ReturnsCorrectType_WhenDBHasOneResource()
        {
            mockRepo.Setup(repo => repo.GetAllTimelineEvents()).Returns(GetTimelineEvents(1));

            var controller = new TimelineController(mockRepo.Object, mapper);

            var result = controller.GetAllTimelineEvents();

            Assert.IsType <ActionResult <IEnumerable <TimelineEventReadDto> > >(result);
        }
        public void GetTimelineEventItems_Returns200OK_WhenDBHasOneResource()
        {
            mockRepo.Setup(repo => repo.GetAllTimelineEvents()).Returns(GetTimelineEvents(1));

            var controller = new TimelineController(mockRepo.Object, mapper);

            var result = controller.GetAllTimelineEvents();

            Assert.IsType <OkObjectResult>(result.Result);
        }
Exemplo n.º 19
0
    public CombatGameState(GameStateMachine gameStateMachine)
    {
        this.gameStateMachine = gameStateMachine;

        this.tilemapManager       = DependencyLocator.getTilemapManager();
        this.timelineController   = DependencyLocator.getTimelineController();
        this.skillQueueResolver   = DependencyLocator.GetSkillQueueResolver();
        this.combatActionsMapping = DependencyLocator.GetActionsMapper <CombatActionsMapping>();
        this.spawner = DependencyLocator.GetSpawner();
    }
        public void PartialTimelineEventUpdate_Returns404NotFound_WhenNonExistentResourceIDSubmitted()
        {
            mockRepo.Setup(repo => repo.GetTimelineEventById(0)).Returns(() => null);

            var controller = new TimelineController(mockRepo.Object, mapper);

            var result = controller.UpdateTimelineEvent(0, new Microsoft.AspNetCore.JsonPatch.JsonPatchDocument <TimelineEventUpdateDto> {
            });

            Assert.IsType <NotFoundResult>(result);
        }
Exemplo n.º 21
0
        public static void CommandHandler(object target, ExecutedRoutedEventArgs ea)
        {
            ea.Handled = true;
            var mainWindow = (MainWindow)Application.Current.MainWindow;
            var tweet      = ea.Parameter as Tweet ?? mainWindow.Timeline.GetSelectedTweet;

            if (tweet == null)
            {
                return;
            }
            TimelineController.CopyLinkToClipboard(tweet);
        }
Exemplo n.º 22
0
 private void Awake()
 {
     // 複数個作成しないようにする
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Exemplo n.º 23
0
 public TimelineEditorView(String name, Timeline timeline, TimelineController timelineController, EditorController editorController, PropEditController propEditController)
     : base(name)
 {
     ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Bottom)
     {
         AllowedDockLocations = DockLocation.Top | DockLocation.Bottom | DockLocation.Floating
     };
     this.Timeline           = timeline;
     this.TimelineController = timelineController;
     this.EditorController   = editorController;
     this.PropEditController = propEditController;
 }
        public void GetTimelineEventItems_Returns200OK_WhenDBIsEmpty()
        {
            // Arrange
            mockRepo.Setup(repo => repo.GetAllTimelineEvents()).Returns(GetTimelineEvents(0));

            var controller = new TimelineController(mockRepo.Object, mapper);

            // Act
            var result = controller.GetAllTimelineEvents();

            // Assert
            Assert.IsType <OkObjectResult>(result.Result);
        }
        public void GetTimelineEventItems_ReturnsOneItem_WhenDBHasOneResource()
        {
            mockRepo.Setup(repo => repo.GetAllTimelineEvents()).Returns(GetTimelineEvents(1));

            var controller = new TimelineController(mockRepo.Object, mapper);

            var result = controller.GetAllTimelineEvents();

            var okResult = result.Result as OkObjectResult;

            var timelineEvents = okResult.Value as List <TimelineEventReadDto>;

            Assert.Single(timelineEvents);
        }
Exemplo n.º 26
0
        public void Controller_Home_Index_Default_Should_Pass()
        {
            // Arrange
            TimelineController controller = new TimelineController();

            var test = controller.Index();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.IsNotNull(result, TestContext.TestName);
            Assert.IsNotNull(test, TestContext.TestName);
        }
Exemplo n.º 27
0
        public void TimelineController_Get_BadRequest_Test()
        {
            // Arrange
            Mock <ITimelineService> mock = new Mock <ITimelineService>(MockBehavior.Strict);

            mock.Setup(setup => setup.Get(It.IsAny <int>())).Throws(new Exception());
            TimelineController target = new TimelineController(mock.Object);

            // Act
            IHttpActionResult result = target.Get(12);

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result is BadRequestErrorMessageResult);
        }
Exemplo n.º 28
0
        /// <summary>
        /// 後片付けをする
        /// </summary>
        public void DeInitPluginCore()
        {
            if (!this.isLoaded)
            {
                return;
            }

            try
            {
                // 設定ファイルを保存する
                Settings.Default.Save();
                Settings.Default.DeInit();
                FFXIV.Framework.Config.Save();
                FFXIV.Framework.Config.Free();

                // 付加情報オーバーレイを閉じる
                LPSView.CloseLPS();
                POSView.ClosePOS();

                PluginMainWorker.Instance.End();
                PluginMainWorker.Free();
                TimelineController.Free();

                this.RemoveSwitchVisibleButton();

                if (this.PluginStatusLabel != null)
                {
                    this.PluginStatusLabel.Text = "Plugin Exited";
                }

                Logger.Write("Plugin Exited.");
            }
            catch (Exception ex)
            {
                ActGlobals.oFormActMain.WriteExceptionLog(
                    ex,
                    "Plugin deinit error.");

                Logger.Write("Plugin deinit error.", ex);

                if (this.PluginStatusLabel != null)
                {
                    this.PluginStatusLabel.Text = "Plugin Exit Error";
                }
            }

            Logger.DeInit();
        }
Exemplo n.º 29
0
    void Start()
    {
        _tlc = Ship.GetComponent <TimelineController>();
        float music;

        if (StorageeHelper.MusicVolume.TryGetValue(out music))
        {
            Mixer.SetFloat("music", SoundHelper.PercentToDecible(music));
        }
        float effects;

        if (StorageeHelper.EffectsVolume.TryGetValue(out effects))
        {
            Mixer.SetFloat("effects", SoundHelper.PercentToDecible(music));
        }
    }
Exemplo n.º 30
0
        /// <summary>
        /// Opens this instance.
        /// </summary>
        public void Toggle()
        {
            if (this.Reached)
            {
                this.Visited = true;
            }

            if (this.IsOpen)
            {
                TimelineController.Close();
            }
            else
            {
                TimelineController.Open(this);
            }
        }
Exemplo n.º 31
0
    public SkillEffect(SkillInput skillInput, Skill skill, int effectDuration)
    {
        this.skillQueueResolver = DependencyLocator.GetSkillQueueResolver();
        this.timelineController = DependencyLocator.getTimelineController();

        this.uniqId = (this.timelineController.CurrentPassAgent.UniqId.groupId, ++SkillEffect.selfIdCount);

        int atb = (int)Mathf.Floor(100 - this.timelineController.CurrentPassPriorityScore * this.Speed) % 100;

        atb      = (atb + 100) % 100;
        this.Atb = atb;

        this.skillInput     = skillInput;
        this.skill          = skill;
        this.effectDuration = effectDuration;
    }