void TestConvertReturnsSingleResponseAsIsForSubTypedResponse() { SubTypedQueryResponse testResponse = new SubTypedQueryResponse(); QueryResponse?result = TestSubject.Convert(testResponse); Assert.Equal(testResponse, result); }
void TestConvertReturnsEmptyListForResponseOfDifferentListTypeIfTheListIsEmpty() { List <IQueryResponseInterface> testResponse = new List <IQueryResponseInterface>(); List <QueryResponse>?result = TestSubject.Convert(testResponse); Assert.True(!result.Any()); }
void TestConvertReturnsListOnResponseOfSubTypedArrayType() { SubTypedQueryResponse[] testResponse = new SubTypedQueryResponse[] { new SubTypedQueryResponse() }; List <QueryResponse>?result = TestSubject.Convert(testResponse); Assert.Equal(testResponse.Length, result?.Count); Assert.Equal(testResponse[0], result?[0]); }
void TestConvertThrowsExceptionForResponseOfDifferentListType() { List <QueryResponseFromInterface> testResponse = new List <QueryResponseFromInterface>(); testResponse.Add(new QueryResponseFromInterface() { }); Assert.Throws <ArgumentException>(() => TestSubject.Convert(testResponse)); }
void TestConvertReturnsListOnResponseOfSetType() { HashSet <QueryResponse> testResponse = new HashSet <QueryResponse>(); testResponse.Add(new QueryResponse()); List <QueryResponse>?result = TestSubject.Convert(testResponse); Assert.Equal(testResponse.Count, result?.Count); Assert.Equal(testResponse.First(), result?[0]); }
void TestConvertReturnsListOnResponseOfSubTypedListType() { List <SubTypedQueryResponse> testResponse = new List <SubTypedQueryResponse>(); testResponse.Add(new SubTypedQueryResponse()); List <QueryResponse>?result = TestSubject.Convert(testResponse); Assert.Equal(testResponse.Count, result?.Count); Assert.Equal(testResponse[0], result?[0]); }
void TestConvertThrowsExceptionForResponseOfDifferentArrayType() { IQueryResponseInterface[] testResponse = { new QueryResponseFromInterface() { } }; Assert.Throws <ArgumentException>(() => TestSubject.Convert(testResponse)); }
void TestConvertThrowsClassCastExceptionForMultipleInstanceResponse() { Assert.Throws <InvalidCastException>(() => { QueryResponse?convert = TestSubject.Convert(new QueryResponse[] {}); }); }
void TestConvertThrowsClassCastExceptionForDifferentSingleInstanceResponse() { Assert.Throws <InvalidCastException>(() => { QueryResponse?convert = TestSubject.Convert(new QueryResponseFromInterface()); }); }
protected override void Act() { _actualFilters = TestSubject.Convert(new ClaimsAuthorizationSegment[0]); }
protected override void Act() { // Execute code under test _actualFilters = TestSubject.Convert( Supplied <IReadOnlyList <ClaimsAuthorizationSegment> >()); }
void TestConvertThrowsExceptionForSingleInstanceResponse() { Assert.Throws <ArgumentException>(() => TestSubject.Convert(new QueryResponse())); }