public void CanAccessDeserializedUnknownOperation() { var paymentResponse = JsonSerializer.Deserialize <CardPaymentResponseDto>(TestResponse, JsonSerialization.JsonSerialization.Settings); var client = new HttpClient(); var operations = new CardPaymentOperations(paymentResponse.Operations.Map(), client); Assert.Contains(operations, a => a.Key.Name.Equals(TestOperationName, System.StringComparison.OrdinalIgnoreCase)); Assert.Contains(operations, a => a.Key.Value.Equals(TestOperationName, System.StringComparison.OrdinalIgnoreCase)); }
public void UnknownOperation_IsDeserializedTo_LinkrelationType() { var paymentResponse = JsonSerializer.Deserialize <CardPaymentResponseDto>(TestResponse, JsonSerialization.JsonSerialization.Settings); var client = new HttpClient(); var operations = new CardPaymentOperations(paymentResponse.Operations.Map(), client); var testLinkRelation = new LinkRelation(TestOperationName, TestOperationName); Assert.True(operations.ContainsKey(testLinkRelation), "Missing link relation in Operation list"); Assert.True(operations.TryGetValue(testLinkRelation, out var httpOperation), "Missing value in operation list"); Assert.Equal("text/html", httpOperation.ContentType); Assert.Equal(HttpMethod.Get, httpOperation.Method); }