dsian.TwinCAT.Ads.Server.Mock.Extensions 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package dsian.TwinCAT.Ads.Server.Mock.Extensions --version 0.1.0                
NuGet\Install-Package dsian.TwinCAT.Ads.Server.Mock.Extensions -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="dsian.TwinCAT.Ads.Server.Mock.Extensions" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add dsian.TwinCAT.Ads.Server.Mock.Extensions --version 0.1.0                
#r "nuget: dsian.TwinCAT.Ads.Server.Mock.Extensions, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install dsian.TwinCAT.Ads.Server.Mock.Extensions as a Cake Addin
#addin nuget:?package=dsian.TwinCAT.Ads.Server.Mock.Extensions&version=0.1.0

// Install dsian.TwinCAT.Ads.Server.Mock.Extensions as a Cake Tool
#tool nuget:?package=dsian.TwinCAT.Ads.Server.Mock.Extensions&version=0.1.0                

build

dsian.TwinCAT.Ads.Server.Mock.Extensions

Extension methods for dsian.TwinCAT.Ads.Server.Mock, on Nuget.


Replay

Extension to register Behaviors from a recorded TC3 ADS Monitor file (*.cap, see dsian.TwinCAT.AdsViewer.CapParser or Nuget).
This can be used for more sophisticated ADS requests, like reading symbols from a server.
With that tool, you can record a specific ADS communication and replay it for unit testing, see documentation TF6010 | TwinCAT ADS Monitor.

using (var serverMock = new Mock(12347, "AdsServerMock"))
{
    serverMock.RegisterReplay(@".\TestFiles\RecordedAdsCommunication.cap");
    // . . .
}

<a name="replayexample"/>

Example

using (var serverMock = new Mock(12347, "AdsServerMock"))
{
    serverMock.RegisterReplay(@".\TestFiles\RecordedAdsCommunication.cap");
    using (var client = new AdsClient())
    {
        // connect to our mocking server
        client.Connect(serverMock.ServerAddress.Port);
        if (client.IsConnected)
        {
            var symbolLoader = SymbolLoaderFactory.Create(client, new SymbolLoaderSettings(SymbolsLoadMode.Flat, TcAds.ValueAccess.ValueAccessMode.Default));
            var symbols = await symbolLoader.GetSymbolsAsync(CancellationToken.None);
            Assert.IsTrue(symbols.Succeeded);
        }
    }
}

TC3 ADS Monitor:

Download: TF6010 | TC3 ADS Monitor
Documentation: infosys.beckhoff.com
Minimum requirement for TC3 ADS Monitor: TC1000 | TC3 ADS

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.7.0 712 11/26/2022
0.2.1 339 11/26/2022
0.2.0 328 11/26/2022
0.1.0 360 1/8/2021