GetTimeUntilActive() public method

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
return System.TimeSpan
Ejemplo n.º 1
0
        public void EventsService_GetState_GetTimeUntilActive_Null_Invalid()
        {
            EventsService es = new EventsService();

            var timeUntilActive = es.GetTimeUntilActive(null);

            Assert.AreEqual(TimeSpan.MinValue, timeUntilActive);
        }
Ejemplo n.º 2
0
        public void EventsService_GetState_GetTimeUntilActive_Blank_Invalid()
        {
            EventsService es = new EventsService();

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

            Assert.AreEqual(TimeSpan.MinValue, timeUntilActive);
        }
Ejemplo n.º 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);
        }