コード例 #1
0
        public void SetCurrenTime_TimerStartedAndNewCurrentTimeOlderThanStart_TimerCancelled()
        {
            EventButtonVM button = new EventButtonVM {
                Model   = new AnalysisEventButton(),
                Mode    = DashboardMode.Code,
                TagMode = TagMode.Free
            };

            button.CurrentTime = new Time {
                TotalSeconds = 4999
            };
            button.Click();
            button.CurrentTime = new Time {
                TotalSeconds = 5000
            };

            button.CurrentTime = new Time {
                TotalSeconds = 3000
            };

            Assert.IsNull(button.ButtonTime);
            Assert.IsNull(button.RecordingStart);
        }
コード例 #2
0
        public void Click_EventButtonVM_NotifiesOk()
        {
            // Arrange
            EventButton   button = new EventButton();
            EventButtonVM sut    = new EventButtonVM {
                Model = button
            };

            sut.CurrentTime = new Time();
            bool       notified = false;
            List <Tag> tags     = null;

            App.Current.EventsBroker.Subscribe <NewTagEvent> ((e) => {
                notified = true;
                tags     = e.Tags.ToList();
            });

            // Act
            sut.Click();

            // Assert
            Assert.IsTrue(notified);
            Assert.AreEqual(0, tags.Count());
        }