Skip to content

Commit 1214539

Browse files
committed
Published
1 parent 4c54882 commit 1214539

File tree

15 files changed

+386
-269
lines changed

15 files changed

+386
-269
lines changed

DemoCoreWeb.ClientApi/DemoCoreWeb.ClientApi.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,4 @@
44
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66

7-
<ItemGroup>
8-
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
9-
</ItemGroup>
10-
117
</Project>
+138-141
Original file line numberDiff line numberDiff line change
@@ -1,141 +1,138 @@
1-
//------------------------------------------------------------------------------
2-
// <auto-generated>
3-
// This code was generated by a tool.
4-
//
5-
// Changes to this file may cause incorrect behavior and will be lost if
6-
// the code is regenerated.
7-
// </auto-generated>
8-
//------------------------------------------------------------------------------
9-
10-
namespace DemoCoreWeb.Client
11-
{
12-
13-
14-
public class WeatherForecast : object
15-
{
16-
17-
public System.DateTime Date { get; set; }
18-
19-
public string Summary { get; set; }
20-
21-
public int TemperatureC { get; set; }
22-
}
23-
}
24-
namespace DemoCoreWeb.Controllers.Client
25-
{
26-
using System;
27-
using System.Linq;
28-
using System.Collections.Generic;
29-
using System.Threading.Tasks;
30-
using System.Net.Http;
31-
using Newtonsoft.Json;
32-
33-
34-
public partial class WeatherForecast
35-
{
36-
37-
private System.Net.Http.HttpClient client;
38-
39-
private JsonSerializerSettings jsonSerializerSettings;
40-
41-
public WeatherForecast(System.Net.Http.HttpClient client, JsonSerializerSettings jsonSerializerSettings=null)
42-
{
43-
if (client == null)
44-
throw new ArgumentNullException(nameof(client), "Null HttpClient.");
45-
46-
if (client.BaseAddress == null)
47-
throw new ArgumentNullException(nameof(client), "HttpClient has no BaseAddress");
48-
49-
this.client = client;
50-
this.jsonSerializerSettings = jsonSerializerSettings;
51-
}
52-
53-
/// <summary>
54-
/// GET WeatherForecast
55-
/// </summary>
56-
public async Task<DemoCoreWeb.Client.WeatherForecast[]> GetAsync()
57-
{
58-
var requestUri = "WeatherForecast";
59-
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
60-
var responseMessage = await client.SendAsync(httpRequestMessage);
61-
try
62-
{
63-
responseMessage.EnsureSuccessStatusCode();
64-
var stream = await responseMessage.Content.ReadAsStreamAsync();
65-
using JsonReader jsonReader = new JsonTextReader(new System.IO.StreamReader(stream));
66-
var serializer = JsonSerializer.Create(jsonSerializerSettings);
67-
return serializer.Deserialize<DemoCoreWeb.Client.WeatherForecast[]>(jsonReader);
68-
}
69-
finally
70-
{
71-
responseMessage.Dispose();
72-
}
73-
}
74-
75-
/// <summary>
76-
/// GET WeatherForecast
77-
/// </summary>
78-
public DemoCoreWeb.Client.WeatherForecast[] Get()
79-
{
80-
var requestUri = "WeatherForecast";
81-
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
82-
var responseMessage = client.SendAsync(httpRequestMessage).Result;
83-
try
84-
{
85-
responseMessage.EnsureSuccessStatusCode();
86-
var stream = responseMessage.Content.ReadAsStreamAsync().Result;
87-
using JsonReader jsonReader = new JsonTextReader(new System.IO.StreamReader(stream));
88-
var serializer = JsonSerializer.Create(jsonSerializerSettings);
89-
return serializer.Deserialize<DemoCoreWeb.Client.WeatherForecast[]>(jsonReader);
90-
}
91-
finally
92-
{
93-
responseMessage.Dispose();
94-
}
95-
}
96-
97-
/// <summary>
98-
/// GET WeatherForecast/appsettings
99-
/// </summary>
100-
public async Task<string> GetSettingsAsync()
101-
{
102-
var requestUri = "WeatherForecast/appsettings";
103-
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
104-
var responseMessage = await client.SendAsync(httpRequestMessage);
105-
try
106-
{
107-
responseMessage.EnsureSuccessStatusCode();
108-
if (responseMessage.StatusCode == System.Net.HttpStatusCode.NoContent) { return null; }
109-
var stream = await responseMessage.Content.ReadAsStreamAsync();
110-
using System.IO.StreamReader streamReader = new System.IO.StreamReader(stream);
111-
return streamReader.ReadToEnd();;
112-
}
113-
finally
114-
{
115-
responseMessage.Dispose();
116-
}
117-
}
118-
119-
/// <summary>
120-
/// GET WeatherForecast/appsettings
121-
/// </summary>
122-
public string GetSettings()
123-
{
124-
var requestUri = "WeatherForecast/appsettings";
125-
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
126-
var responseMessage = client.SendAsync(httpRequestMessage).Result;
127-
try
128-
{
129-
responseMessage.EnsureSuccessStatusCode();
130-
if (responseMessage.StatusCode == System.Net.HttpStatusCode.NoContent) { return null; }
131-
var stream = responseMessage.Content.ReadAsStreamAsync().Result;
132-
using System.IO.StreamReader streamReader = new System.IO.StreamReader(stream);
133-
return streamReader.ReadToEnd();;
134-
}
135-
finally
136-
{
137-
responseMessage.Dispose();
138-
}
139-
}
140-
}
141-
}
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by a tool.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
namespace DemoCoreWeb.Client
11+
{
12+
13+
14+
public class WeatherForecast : object
15+
{
16+
17+
public System.DateTime Date { get; set; }
18+
19+
public string Summary { get; set; }
20+
21+
public int TemperatureC { get; set; }
22+
}
23+
}
24+
namespace DemoCoreWeb.Controllers.Client
25+
{
26+
using System;
27+
using System.Linq;
28+
using System.Collections.Generic;
29+
using System.Threading.Tasks;
30+
using System.Net.Http;
31+
using System.Text.Json;
32+
using System.Text.Json.Serialization;
33+
34+
35+
public partial class WeatherForecast
36+
{
37+
38+
private System.Net.Http.HttpClient client;
39+
40+
private JsonSerializerOptions jsonSerializerSettings;
41+
42+
public WeatherForecast(System.Net.Http.HttpClient client, JsonSerializerOptions jsonSerializerSettings=null)
43+
{
44+
if (client == null)
45+
throw new ArgumentNullException(nameof(client), "Null HttpClient.");
46+
47+
if (client.BaseAddress == null)
48+
throw new ArgumentNullException(nameof(client), "HttpClient has no BaseAddress");
49+
50+
this.client = client;
51+
this.jsonSerializerSettings = jsonSerializerSettings;
52+
}
53+
54+
/// <summary>
55+
/// GET WeatherForecast
56+
/// </summary>
57+
public async Task<DemoCoreWeb.Client.WeatherForecast[]> GetAsync()
58+
{
59+
var requestUri = "WeatherForecast";
60+
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
61+
var responseMessage = await client.SendAsync(httpRequestMessage);
62+
try
63+
{
64+
responseMessage.EnsureSuccessStatusCode();
65+
var contentString = await responseMessage.Content.ReadAsStringAsync();
66+
return JsonSerializer.Deserialize<DemoCoreWeb.Client.WeatherForecast[]>(contentString, jsonSerializerSettings);
67+
}
68+
finally
69+
{
70+
responseMessage.Dispose();
71+
}
72+
}
73+
74+
/// <summary>
75+
/// GET WeatherForecast
76+
/// </summary>
77+
public DemoCoreWeb.Client.WeatherForecast[] Get()
78+
{
79+
var requestUri = "WeatherForecast";
80+
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
81+
var responseMessage = client.SendAsync(httpRequestMessage).Result;
82+
try
83+
{
84+
responseMessage.EnsureSuccessStatusCode();
85+
var contentString = responseMessage.Content.ReadAsStringAsync().Result;
86+
return JsonSerializer.Deserialize<DemoCoreWeb.Client.WeatherForecast[]>(contentString, jsonSerializerSettings);
87+
}
88+
finally
89+
{
90+
responseMessage.Dispose();
91+
}
92+
}
93+
94+
/// <summary>
95+
/// GET WeatherForecast/appsettings
96+
/// </summary>
97+
public async Task<string> GetSettingsAsync()
98+
{
99+
var requestUri = "WeatherForecast/appsettings";
100+
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
101+
var responseMessage = await client.SendAsync(httpRequestMessage);
102+
try
103+
{
104+
responseMessage.EnsureSuccessStatusCode();
105+
if (responseMessage.StatusCode == System.Net.HttpStatusCode.NoContent) { return null; }
106+
var stream = await responseMessage.Content.ReadAsStreamAsync();
107+
using System.IO.StreamReader streamReader = new System.IO.StreamReader(stream);
108+
return streamReader.ReadToEnd();;
109+
}
110+
finally
111+
{
112+
responseMessage.Dispose();
113+
}
114+
}
115+
116+
/// <summary>
117+
/// GET WeatherForecast/appsettings
118+
/// </summary>
119+
public string GetSettings()
120+
{
121+
var requestUri = "WeatherForecast/appsettings";
122+
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, requestUri);
123+
var responseMessage = client.SendAsync(httpRequestMessage).Result;
124+
try
125+
{
126+
responseMessage.EnsureSuccessStatusCode();
127+
if (responseMessage.StatusCode == System.Net.HttpStatusCode.NoContent) { return null; }
128+
var stream = responseMessage.Content.ReadAsStreamAsync().Result;
129+
using System.IO.StreamReader streamReader = new System.IO.StreamReader(stream);
130+
return streamReader.ReadToEnd();;
131+
}
132+
finally
133+
{
134+
responseMessage.Dispose();
135+
}
136+
}
137+
}
138+
}

DemoCoreWeb/CodeGen.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"GenerateBothAsyncAndSync": true,
1616
"StringAsString": true,
1717
"CamelCase": true,
18+
"UseSystemTextJson": true,
1819

1920
"Plugins": []
2021
}

Doc/FonlowTesting.vpp

636 KB
Binary file not shown.

Doc/Packages.png

5.27 KB
Loading

Fonlow.Testing.Basic/Fonlow.Testing.Basic.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5-
<Version>1.0-Alpha</Version>
5+
<Version>1.0</Version>
66
<Authors>Zijian Huang</Authors>
77
<Description>Basic types and functions of Fonlow.Testing.Integration suite.</Description>
88
<PackageReleaseNotes></PackageReleaseNotes>

0 commit comments

Comments
 (0)