Black Market getting closer

Tests are green, whohoo, refactoring 😀 Just kidding! Can you see from the tests what this sentence in my spec exactly means?

The black market will be available every weekend.

Well at least my weekend begins in most cases at that time. Fingers crossed tomorrow as well, hehe!

public function testIsBlackMarketAvailable_startOfWeekend()
{
    $this->givenCurrentTime('2015-09-18 18:00:00');
    $this->thenBlackMarketIsAvailable();
}

public function testIsBlackMarketAvailable_middleOfWeekend()
{
    $this->givenCurrentTime('2015-09-19 21:30:41');
    $this->thenBlackMarketIsAvailable();
}

public function testIsBlackMarketAvailable_endOfWeekend()
{
    $this->givenCurrentTime('2015-09-20 23:59:59');
    $this->thenBlackMarketIsAvailable();
}

public function testIsBlackMarketAvailable_startOfWeek()
{
    $this->givenCurrentTime('2015-09-21 00:00:00');
    $this->thenBlackMarketIsNotAvailable();
}

public function testIsBlackMarketAvailable_endOfWeek()
{
    $this->givenCurrentTime('2015-09-25 17:59:59');
    $this->thenBlackMarketIsNotAvailable();
}

public function testIsBlackMarketAvailable_startOfWeekendBecauseTimeZoneOffset()
{
    $this->givenTimezoneOffset(1);
    $this->givenCurrentTime('2015-09-25 17:00:00');
    $this->thenBlackMarketIsAvailable();
}

public function testIsBlackMarketAvailable_endOfWeekendBecauseTimeZoneOffset()
{
    $this->givenTimezoneOffset(-5);
    $this->givenCurrentTime('2015-09-21 04:59:59');
    $this->thenBlackMarketIsAvailable();
}

5 thoughts on “Black Market getting closer

Leave a Reply

Your email address will not be published.