Skip to content

Commit

Permalink
Merge pull request #31 from pyrocumulus/search-by-size-or-postcode
Browse files Browse the repository at this point in the history
Enable SearchService.SearchByPostCodeOrSize
  • Loading branch information
pyrocumulus authored Apr 16, 2020
2 parents 3decfca + 19335fa commit 197c21b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Unreleased

- Added SearchService.SearchByPostCodeOrSize, a method to search for both parameters at the same time [#31](https://github.com/pyrocumulus/pvoutput.net/pull/31)

## [0.7.0] - 2020-04-08

### Added
Expand Down
3 changes: 1 addition & 2 deletions src/PVOutput.Net/Modules/SearchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public Task<PVOutputArrayResponse<ISystemSearchResult>> SearchByNameAsync(string
return handler.ExecuteArrayRequestAsync<ISystemSearchResult>(new SearchRequest { SearchQuery = query }, loggingScope, cancellationToken);
}

/*
/// <summary>
/// Search for systems that have either a postcode or total size that begins with a value.
/// </summary>
Expand All @@ -92,7 +91,7 @@ public Task<PVOutputArrayResponse<ISystemSearchResult>> SearchByPostcodeOrSizeAs

var handler = new RequestHandler(Client);
return handler.ExecuteArrayRequestAsync<ISystemSearchResult>(new SearchRequest { SearchQuery = query }, loggingScope, cancellationToken);
}*/
}

/// <summary>
/// Search for systems by postcode.
Expand Down
10 changes: 5 additions & 5 deletions tests/PVOutput.Net.Tests/Modules/Search/SearchServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public async Task SearchService_SearchByNameContains_CallsCorrectUri()
await TestSpecificSearchQuery(s => s.SearchByNameAsync("name", false), "name");
}

//[Test]
//public async Task SearchService_SearchByPostcodeOrSize_CallsCorrectUri()
//{
// await TestSpecificSearchQuery(s => s.SearchByPostcodeOrSizeAsync(2500), "2500");
//}
[Test]
public async Task SearchService_SearchByPostcodeOrSize_CallsCorrectUri()
{
await TestSpecificSearchQuery(s => s.SearchByPostcodeOrSizeAsync(2500), "2500");
}

[Test]
public async Task SearchService_SearchByPostcode_CallsCorrectUri()
Expand Down

0 comments on commit 197c21b

Please sign in to comment.