public async Task ThenItShouldCallTheApiWithTheCorrectUrl(int pageNumber, int pageSize, string toDateString) { // Arrange var toYear = int.Parse(toDateString.Substring(0, 4)); var toMonth = int.Parse(toDateString.Substring(4, 2)); var toDay = int.Parse(toDateString.Substring(6, 2)); // Act await _apiClient.GetPageOfAccounts(pageNumber, pageSize, new DateTime(toYear, toMonth, toDay)); // Assert var expectedUrl = $"http://some-url/api/accounts?pageNumber={pageNumber}&pageSize={pageSize}&toDate={toDateString}"; _httpClient.Verify(c => c.GetAsync(expectedUrl), Times.Once); }