public async Task <IActionResult> List([FromQuery] ListFromQuery query) { var request = new ListRequest(query); var result = await _apiResult.Produce(request); return(result); }
public void ConstructorShouldFailWhenQueryIsNull() { // Arrange ListFromQuery query = null; // Act Action ctor = () => { new ListRequest(query); }; // Assert ctor.Should().Throw <ArgumentNullException>(); }
public void ConstructorShouldSucceed() { // Arrange var query = new ListFromQuery(); // Act var obj = new ListRequest(query); // Assert obj.Should().NotBeNull(); }
public void MemberQueryApiVersionShouldHaveCorrectValue() { // Arrange var apiVersion = "1.0"; var query = new ListFromQuery() { ApiVersion = apiVersion }; // Act var obj = new ListRequest(query); // Assert obj.QueryApiVersion.Should().Be(apiVersion); }
public ListRequest(ListFromQuery query) { _query = query ?? throw new ArgumentNullException(nameof(query)); }