GeneSIPs 1.0.4
See the version list below for details.
dotnet add package GeneSIPs --version 1.0.4
NuGet\Install-Package GeneSIPs -Version 1.0.4
<PackageReference Include="GeneSIPs" Version="1.0.4" />
paket add GeneSIPs --version 1.0.4
#r "nuget: GeneSIPs, 1.0.4"
// Install GeneSIPs as a Cake Addin #addin nuget:?package=GeneSIPs&version=1.0.4 // Install GeneSIPs as a Cake Tool #tool nuget:?package=GeneSIPs&version=1.0.4
GeneSIPS
GeneSIPS is a simplistic library for bulk generation of SIPs datagrams.
Methodology
Since SIP Datagrams are really just text structures following IETF documents https://tools.ietf.org/html/rfc3261 and https://tools.ietf.org/html/rfc2046, the primary goal of this library is to build the structure of the message in string format such that it can be encoded and piped into a UDP Client.
Generation
Each class and its subclass will contain a public faker object. While the library has "general" rules defined, you can also build your own Faker<T> objects and pass them to each class as a constructor to override the default value.
Testing
Each class (Or Line in the message) will contain its own Regex value to test for validity. As such you can bulk generate data, and then validate each line (and then the entire message) against the regex.
Usage
The first case is just generating a datagram:
SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();
This will provide you an actual Datagram object. If you want the raw datagram converted to test, you can just call ToString()
on the object:
string Datagram = TestMessage.ToString()
Custom Fakers
I'm in the process of implementing static faker settings across all objects, but let's look at the SIPMessage object. The below allows you to create a custom Faker for the entire object that, in this case, leaves the Body null:
Faker<SIPMessage> CustomFaker = new Faker<SIPMessage>()
.StrictMode(false)
.RuleFor(o => o.Body, f => null)
.RuleFor(o => o.RequestLine, f => RequestLine.Faker.Generate(1).First())
.RuleFor(o => o.Header, f => MessageHeader.Faker.Generate(1).First());
SIPMessage.SetCustomFaker(CustomFaker);
SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();
Bulk Generation
If you're looking at bulk-generating datagrams, you will do it via Faker.Generate(x)
. As a heads up, initial benchmarking was able to produce 50,000 in 2.2 seconds. Can probably be tuned down, but should also be implemented in parallel if you need large volumes.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. |
.NET Core | netcoreapp2.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.2
- Bogus (>= 25.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed default faker rules to create a number that would be valid internationally (Stripped extension) and built test for it.