@@ -55,17 +55,7 @@ and passing a `PostData<object>` object to a method taking `PostData<object>` sh
5555[source,csharp]
5656----
5757fromString = ImplicitlyConvertsFrom(fromString);
58- ----
5958
60- [source,csharp]
61- ----
62- await this.AssertOn(new ConnectionSettings());
63-
64- await this.AssertOn(new ConnectionConfiguration());
65- ----
66-
67- [source,csharp]
68- ----
6959fromByteArray = ImplicitlyConvertsFrom(fromByteArray);
7060fromListOfString = ImplicitlyConvertsFrom(fromListOfString);
7161fromListOfObject = ImplicitlyConvertsFrom(fromListOfObject);
@@ -77,90 +67,3 @@ fromListOfObject.Type.Should().Be(PostType.EnumerableOfObject);
7767fromObject.Type.Should().Be(PostType.Serializable);
7868----
7969
80- Although each implicitly types behaves slightly differently
81-
82- [source,csharp]
83- ----
84- await Post(() => @string, writes: Utf8Bytes(@string), storesBytes: true, settings: settings);
85-
86- await Post(() => bytes, writes: bytes, storesBytes: true, settings: settings);
87- ----
88-
89- When passing a list of strings we assume its a list of valid serialized json that we
90- join with newline feeds making sure there is a trailing linefeed
91-
92- [source,csharp]
93- ----
94- await Post(() => listOfStrings, writes: multiStringJson, storesBytes: true, settings: settings);
95- ----
96-
97- When passing a list of object we assume its a list of objects we need to serialize
98- individually to json and join with newline feeds making sure there is a trailing linefeed
99-
100- [source,csharp]
101- ----
102- await Post(() => listOfObjects, writes: multiObjectJson, storesBytes: false, settings: settings);
103- ----
104-
105- In all other cases postdata is serialized as is.
106-
107- [source,csharp]
108- ----
109- await Post(() => @object, writes: objectJson, storesBytes: false, settings: settings);
110- ----
111-
112- If you want to maintain a copy of the request that went out, use `DisableDirectStreaming`
113-
114- [source,csharp]
115- ----
116- settings = new ConnectionSettings().DisableDirectStreaming();
117- ----
118-
119- by forcing `DisableDirectStreaming` on connection settings, serialization happens first in a private `MemoryStream`
120- so we can get hold of the serialized bytes
121-
122- [source,csharp]
123- ----
124- await Post(() => listOfObjects, writes: multiObjectJson, storesBytes: true, settings: settings);
125- ----
126-
127- this behavior can also be observed when serializing a simple object using `DisableDirectStreaming`
128-
129- [source,csharp]
130- ----
131- await Post(() => @object, writes: objectJson, storesBytes: true, settings: settings);
132- ----
133-
134- [source,csharp]
135- ----
136- PostAssert(postData(), writes, storesBytes, settings);
137-
138- await PostAssertAsync(postData(), writes, storesBytes, settings);
139- ----
140-
141- [source,csharp]
142- ----
143- postData.Write(ms, settings);
144-
145- var sentBytes = ms.ToArray();
146-
147- sentBytes.Should().Equal(writes);
148-
149- postData.WrittenBytes.Should().NotBeNull();
150-
151- postData.WrittenBytes.Should().BeNull();
152- ----
153-
154- [source,csharp]
155- ----
156- await postData.WriteAsync(ms, settings);
157-
158- var sentBytes = ms.ToArray();
159-
160- sentBytes.Should().Equal(writes);
161-
162- postData.WrittenBytes.Should().NotBeNull();
163-
164- postData.WrittenBytes.Should().BeNull();
165- ----
166-
0 commit comments