RBSoftTech.DummyNET.Core
1.0.1
dotnet add package RBSoftTech.DummyNET.Core --version 1.0.1
NuGet\Install-Package RBSoftTech.DummyNET.Core -Version 1.0.1
<PackageReference Include="RBSoftTech.DummyNET.Core" Version="1.0.1" />
<PackageVersion Include="RBSoftTech.DummyNET.Core" Version="1.0.1" />
<PackageReference Include="RBSoftTech.DummyNET.Core" />
paket add RBSoftTech.DummyNET.Core --version 1.0.1
#r "nuget: RBSoftTech.DummyNET.Core, 1.0.1"
#:package RBSoftTech.DummyNET.Core@1.0.1
#addin nuget:?package=RBSoftTech.DummyNET.Core&version=1.0.1
#tool nuget:?package=RBSoftTech.DummyNET.Core&version=1.0.1
DummyNET
DummyNET is a project to make generating dummy data easy. For all information about DummyNET project go to project site.
DummyNET.Core
DummyNET.Core is part of DummyNET project. It is the core library. It defines interfaces and base classes for DummyNET project.
It defines two base engines
- SetDummyEngine
- EnumDummyEngine
SetDummyEngine
SetDummyEngine is a specific implementation of DummyEngine. It creates sequences of values from a defined set.
When a sequence is defined with defined constant behavior, the defined constant value must be contained in set.
Getting started with SetDummyEngine
If you want to build your SetDummyEngine, start with define a set
string[] rainbow = new string[] { "Red", "Orange", "Yellow", "Green", "Ligth Blue", "Indigo", "Violet" };
Now you can define the SequenceOptions
public class RainbowSequenceOptions : SetSequenceOptions<string>
{
public RainbowSequenceOptions(SequenceBehavior behavior,string name)
:this(behavior,name,rainbow,"Red")
{}
public RainbowSequenceOptions(SequenceBehavior behavior,string name,string definedConstantValue)
:base(behavior,name,rainbow,definedConstantValue)
{}
private static readonly string[] rainbow;
static RainbowSequenceOptions()
{
rainbow = new string[] { "Red", "Orange", "Yellow", "Green", "Ligth Blue", "Indigo", "Violet" };
}
}
Now you can define yuor sequence
public class RainbowSequence : SetSequence<string,RainbowSequenceOptions>
{
public RainbowSequence(RainbowSequenceOptions options)
:base(options)
{}
}
The last step is to create your DummyEngine
public class RainbowDummyEngine : SetDummyEngine<string,RainbowSequence,RainbowSequenceOptions>
{
protected override RainbowSequence CreateSequence(RainbowSequenceOptions options)
{
return new RainbowSequence(options);
}
}
Now you are ready to use your SetDummyEngine
string sequenceName = "MyRainbowSequence";
RainbowSequenceOptions options = new RainbowSequenceOptions(SequenceBehavior.Random,sequenceName);
RainbowDummyEngine engine = new RainbowDummyEngine();
engine.StartNewSequence(options);
string rainbowColor = engine.GetValue(sequenceName);
engine.StopSequence(sequenceName);
EnumDummyEngine
EnumDummyEngine is a specific implementation of DummyEngine. It creates sequences of values from an enumerator.
Getting started with EnumDummyEngine
If you want to build your EnumDummyEngine, start with define an enumerator
public enum Trafficlight { Red, Orange, Green};
Now you can define the SequenceOptions
public class TrafficlightSequenceOptions : EnumSequenceOptions<Trafficlight>
{
public TrafficlightSequenceOptions(SequenceBehavior behavior,string name)
:this(behavior,name,default(Trafficlight))
{}
public TrafficlightSequenceOptions(SequenceBehavior behavior,string name,Trafficlight definedConstantValue)
:base(behavior,name,definedConstantValue)
{}
}
Now you can define yuor sequence
public class TrafficlightSequence : EnumSequence<Trafficlight,TrafficlightSequenceOptions>
{
public TrafficlightSequence(TrafficlightSequenceOptions options)
:base(options)
{}
}
The last step is to create your DummyEngine
public class TrafficlightDummyEngine : EnumDummyEngine<Trafficlight,TrafficlightSequence,TrafficlightSequenceOptions>
{
protected override TrafficlightSequence CreateSequence(TrafficlightSequenceOptions options)
{
return new TrafficlightSequence(options);
}
}
Now you are ready to use your EnumDummyEngine
string sequenceName = "MyTrafficlightSequence";
TrafficlightSequenceOptions options = new TrafficlightSequenceOptions(SequenceBehavior.Random,sequenceName);
TrafficlightDummyEngine engine = new TrafficlightDummyEngine();
engine.StartNewSequence(options);
Trafficlight trafficLightStatus = engine.GetValue(sequenceName);
engine.StopSequence(sequenceName);
| 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RBSoftTech.DummyNET.Core:
| Package | Downloads |
|---|---|
|
RBSoftTech.DummyNET.Boolean
DummyNET is a suite of engines to create dummy data. |
GitHub repositories
This package is not used by any popular GitHub repositories.
v.1.0.1
- Fixed array random value extraction
- Fixed exception message
- Reviewed project documentation
- Added project url
v.1.0.0
- Initial release