public async Task PositionIsOpenedAtDefinedHourOnly() { _position.FindOpenPositionsAsync(Arg.Any <string>(), Arg.Any <string>(), Arg.Any <float>()).Returns(Task.FromResult(new List <Position>())); await _underTest.EvaluateRateAsync(Currency.EUR, Currency.USD); await _position.Received().OpenAsync("EUR", "USD", 10f, 2f); _options.OpenHour = DateTime.UtcNow.AddHours(2).Hour; _position.ClearReceivedCalls(); await _underTest.EvaluateRateAsync(Currency.EUR, Currency.USD); await _position.DidNotReceive().OpenAsync("EUR", "USD", 10f, 2f); }