GetTimeUntilActive() 공개 메소드

Retrieves the amount of time until the next active time for the given event, using the megaserver timetables
public GetTimeUntilActive ( WorldBossEvent evt ) : System.TimeSpan
evt GW2PAO.API.Data.Entities.WorldBossEvent The event to retrieve the time for
리턴 System.TimeSpan
예제 #1
0
        public void EventsService_GetState_GetTimeUntilActive_Null_Invalid()
        {
            EventsService es = new EventsService();

            var timeUntilActive = es.GetTimeUntilActive(null);

            Assert.AreEqual(TimeSpan.MinValue, timeUntilActive);
        }
예제 #2
0
        public void EventsService_GetState_GetTimeUntilActive_Blank_Invalid()
        {
            EventsService es = new EventsService();

            var timeUntilActive = es.GetTimeUntilActive(new WorldBossEvent());

            Assert.AreEqual(TimeSpan.MinValue, timeUntilActive);
        }
예제 #3
0
        public void EventsService_GetState_GetTimeUntilActive_Success_RollOver()
        {
            var testEvent = new WorldBossEvent();
            testEvent.ActiveTimes.Add(new SerializableTimespan(2, 0, 0));

            var timeMock = new Mock<ITimeProvider>();
            timeMock.Setup(t => t.CurrentTime).Returns(new DateTimeOffset(new DateTime(2014, 10, 22, 3, 0, 0)));
            EventsService es = new EventsService(null, null, timeMock.Object);

            var timeUntilActive = es.GetTimeUntilActive(testEvent);

            Assert.AreEqual(new TimeSpan(23, 0, 0), timeUntilActive);
        }