mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
Add unit test for the problem.
This commit is contained in:
@@ -949,6 +949,33 @@ namespace S7.Net.UnitTest
|
||||
// Depending on how tests run, this can also just succeed without getting cancelled at all. Do nothing in this case.
|
||||
Console.WriteLine("Task was not cancelled as expected.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write a large amount of data and test cancellation
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public async Task Test_Async_ParseDataIntoDataItemsAlignment()
|
||||
{
|
||||
Assert.IsTrue(plc.IsConnected, "Before executing this test, the plc must be connected. Check constructor.");
|
||||
|
||||
var dataItems = new List<DataItem>
|
||||
{
|
||||
new DataItem
|
||||
{
|
||||
DataType = DataType.DataBlock,
|
||||
DB = 2,
|
||||
VarType = VarType.S7String,
|
||||
Count = 5
|
||||
},
|
||||
new DataItem
|
||||
{
|
||||
DataType = DataType.DataBlock,
|
||||
DB = 2,
|
||||
VarType = VarType.Word,
|
||||
}
|
||||
};
|
||||
await plc.ReadMultipleVarsAsync(dataItems, CancellationToken.None);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user