Skip to content

Commit e1fb0ca

Browse files
committed
docs(http-tests): author XML doc comments on test surface
1 parent 40cab19 commit e1fb0ca

5 files changed

Lines changed: 30 additions & 0 deletions

File tree

tests/MTConnect.NET-HTTP-Tests/Clients/Current.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ namespace MTConnect.Tests.Http.Clients
1111
// MTConnectHttpServer started by AgentRunner, exercising the HTTP current
1212
// request/response path end to end for XML and JSON, all devices, a single
1313
// device and a device path filter.
14+
/// <summary>Pins the behaviour expressed by the test name: current.</summary>
1415
[TestFixture]
1516
public class Current : HttpClientFixture
1617
{
18+
/// <summary>Pins the behaviour expressed by the test name: run xml.</summary>
1719
[Test]
1820
public void RunXml()
1921
{
@@ -25,6 +27,7 @@ public void RunXml()
2527
Assert.That(response.Streams.Count(), Is.EqualTo(ExpectedDocumentEntryCount), "XML Current did not return all device streams");
2628
}
2729

30+
/// <summary>Pins the behaviour expressed by the test name: run json.</summary>
2831
[Test]
2932
public void RunJson()
3033
{
@@ -36,6 +39,7 @@ public void RunJson()
3639
Assert.That(response.Streams.Count(), Is.EqualTo(ExpectedDocumentEntryCount), "JSON Current did not return all device streams");
3740
}
3841

42+
/// <summary>Pins the behaviour expressed by the test name: run device xml.</summary>
3943
[Test]
4044
public void RunDeviceXml()
4145
{
@@ -47,6 +51,7 @@ public void RunDeviceXml()
4751
Assert.That(response.Streams.FirstOrDefault(o => o.Name == DeviceName), Is.Not.Null, $"XML Current did not return device {DeviceName}");
4852
}
4953

54+
/// <summary>Pins the behaviour expressed by the test name: run device json.</summary>
5055
[Test]
5156
public void RunDeviceJson()
5257
{
@@ -58,6 +63,7 @@ public void RunDeviceJson()
5863
Assert.That(response.Streams.FirstOrDefault(o => o.Name == DeviceName), Is.Not.Null, $"JSON Current did not return device {DeviceName}");
5964
}
6065

66+
/// <summary>Pins the behaviour expressed by the test name: run device path xml.</summary>
6167
[Test]
6268
public void RunDevicePathXml()
6369
{

tests/MTConnect.NET-HTTP-Tests/Clients/HttpClientFixture.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,30 @@ namespace MTConnect.Tests.Http.Clients
1515
// per fixture removes that contention. AgentRunner.Start() blocks until the
1616
// server actually answers a Probe, so the first client request never races
1717
// the fire-and-forget socket bind.
18+
/// <summary>Represents the http client fixture.</summary>
1819
public abstract class HttpClientFixture
1920
{
21+
/// <summary>The hostname.</summary>
2022
protected const string Hostname = "127.0.0.1";
23+
/// <summary>The device name.</summary>
2124
protected const string DeviceName = "OKUMA-Lathe";
25+
/// <summary>The device uuid.</summary>
2226
protected const string DeviceUuid = "OKUMA.Lathe.123456";
2327

28+
/// <summary>Gets or sets the agent runner.</summary>
2429
protected AgentRunner AgentRunner { get; private set; } = null!;
2530

31+
/// <summary>Gets or sets the port.</summary>
2632
protected int Port { get; private set; }
2733

2834
// Streams/devices include the implicit Agent device alongside the two
2935
// device files AgentRunner loads, so a full document carries one more
3036
// entry than AgentRunner.Devices.
37+
/// <summary>Gets or sets the expected document entry count.</summary>
3138
protected int ExpectedDocumentEntryCount => AgentRunner.Devices.Count() + 1;
3239

3340

41+
/// <summary>Sets up the fixture before each test.</summary>
3442
[OneTimeSetUp]
3543
public void OneTimeSetUp()
3644
{
@@ -39,6 +47,7 @@ public void OneTimeSetUp()
3947
AgentRunner.Start();
4048
}
4149

50+
/// <summary>Tears down the fixture after each test.</summary>
4251
[OneTimeTearDown]
4352
public void OneTimeTearDown()
4453
{

tests/MTConnect.NET-HTTP-Tests/Clients/Probe.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ namespace MTConnect.Tests.Http.Clients
1111
// MTConnectHttpServer started by AgentRunner, exercising the HTTP probe
1212
// request/response path end to end for XML and JSON, all devices and a
1313
// single device.
14+
/// <summary>Pins the behaviour expressed by the test name: probe.</summary>
1415
[TestFixture]
1516
public class Probe : HttpClientFixture
1617
{
18+
/// <summary>Pins the behaviour expressed by the test name: run xml.</summary>
1719
[Test]
1820
public void RunXml()
1921
{
@@ -25,6 +27,7 @@ public void RunXml()
2527
Assert.That(response.Devices.Count(), Is.EqualTo(ExpectedDocumentEntryCount), "XML Probe did not return all devices");
2628
}
2729

30+
/// <summary>Pins the behaviour expressed by the test name: run json.</summary>
2831
[Test]
2932
public void RunJson()
3033
{
@@ -36,6 +39,7 @@ public void RunJson()
3639
Assert.That(response.Devices.Count(), Is.EqualTo(ExpectedDocumentEntryCount), "JSON Probe did not return all devices");
3740
}
3841

42+
/// <summary>Pins the behaviour expressed by the test name: run device xml.</summary>
3943
[Test]
4044
public void RunDeviceXml()
4145
{
@@ -47,6 +51,7 @@ public void RunDeviceXml()
4751
Assert.That(response.Devices.FirstOrDefault(o => o.Name == DeviceName), Is.Not.Null, $"XML Probe did not return device {DeviceName}");
4852
}
4953

54+
/// <summary>Pins the behaviour expressed by the test name: run device json.</summary>
5055
[Test]
5156
public void RunDeviceJson()
5257
{

tests/MTConnect.NET-HTTP-Tests/Clients/Sample.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ namespace MTConnect.Tests.Http.Clients
1111
// MTConnectHttpServer started by AgentRunner, exercising the HTTP sample
1212
// request/response path end to end for XML and JSON, all devices, a single
1313
// device and a device path filter.
14+
/// <summary>Pins the behaviour expressed by the test name: sample.</summary>
1415
[TestFixture]
1516
public class Sample : HttpClientFixture
1617
{
18+
/// <summary>Pins the behaviour expressed by the test name: run xml.</summary>
1719
[Test]
1820
public void RunXml()
1921
{
@@ -25,6 +27,7 @@ public void RunXml()
2527
Assert.That(response.Streams.Count(), Is.EqualTo(ExpectedDocumentEntryCount), "XML Sample did not return all device streams");
2628
}
2729

30+
/// <summary>Pins the behaviour expressed by the test name: run json.</summary>
2831
[Test]
2932
public void RunJson()
3033
{
@@ -36,6 +39,7 @@ public void RunJson()
3639
Assert.That(response.Streams.Count(), Is.EqualTo(ExpectedDocumentEntryCount), "JSON Sample did not return all device streams");
3740
}
3841

42+
/// <summary>Pins the behaviour expressed by the test name: run device xml.</summary>
3943
[Test]
4044
public void RunDeviceXml()
4145
{
@@ -47,6 +51,7 @@ public void RunDeviceXml()
4751
Assert.That(response.Streams.FirstOrDefault(o => o.Name == DeviceName), Is.Not.Null, $"XML Sample did not return device {DeviceName}");
4852
}
4953

54+
/// <summary>Pins the behaviour expressed by the test name: run device json.</summary>
5055
[Test]
5156
public void RunDeviceJson()
5257
{
@@ -58,6 +63,7 @@ public void RunDeviceJson()
5863
Assert.That(response.Streams.FirstOrDefault(o => o.Name == DeviceName), Is.Not.Null, $"JSON Sample did not return device {DeviceName}");
5964
}
6065

66+
/// <summary>Pins the behaviour expressed by the test name: run device path xml.</summary>
6167
[Test]
6268
public void RunDevicePathXml()
6369
{

tests/MTConnect.NET-HTTP-Tests/Clients/SampleStream.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace MTConnect.Tests.Http.Clients
2020
// asserts the streamed Sample delivers that observation back. This
2121
// exercises the broker ingest/sequence/buffer path and the HTTP server
2222
// stream + HTTP streaming-client per-chunk loop end to end.
23+
/// <summary>Pins the behaviour expressed by the test name: sample client.</summary>
2324
[TestFixture]
2425
public class SampleClient
2526
{
@@ -37,6 +38,7 @@ public class SampleClient
3738
private readonly object _lock = new object();
3839

3940

41+
/// <summary>Sets up the fixture before each test.</summary>
4042
[OneTimeSetUp]
4143
public void OneTimeSetUp()
4244
{
@@ -50,6 +52,7 @@ public void OneTimeSetUp()
5052
_client.Start();
5153
}
5254

55+
/// <summary>Tears down the fixture after each test.</summary>
5356
[OneTimeTearDown]
5457
public void OneTimeTearDown()
5558
{
@@ -88,6 +91,7 @@ private void SampleReceived(object? sender, IStreamsResponseDocument response)
8891
}
8992

9093

94+
/// <summary>Pins the behaviour expressed by the test name: run.</summary>
9195
[Test]
9296
public void Run()
9397
{

0 commit comments

Comments
 (0)