Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 48 additions & 48 deletions Tynamix.ObjectFiller/Filler.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/HashStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ internal bool Push(T item)
/// Removes and returns the last added element.
/// </summary>
/// <returns>
/// The item of type <see cref="T"/>
/// The item of type <typeparamref name="T"/>
/// </returns>
internal T Pop()
{
Expand All @@ -91,7 +91,7 @@ internal void Clear()
}

/// <summary>
/// Checks if the <see cref="HashStack{T}"/> contains the <see cref="item"/>
/// Checks if the <see cref="HashStack{T}"/> contains the <paramref name="item"/>
/// </summary>
/// <param name="item">
/// The item.
Expand Down
2 changes: 1 addition & 1 deletion Tynamix.ObjectFiller/IInterfaceMocker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Tynamix.ObjectFiller
public interface IInterfaceMocker
{
/// <summary>
/// Creates a mock of the interface with type <see cref="T"/>
/// Creates a mock of the interface with type <typeparamref name="T"/>
/// </summary>
/// <typeparam name="T">Type of the interface</typeparam>
/// <returns>Mock of the interface</returns>
Expand Down
8 changes: 4 additions & 4 deletions Tynamix.ObjectFiller/Plugins/DateTime/DateTimeRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public DateTimeRange(DateTime earliestDate, DateTime latestDate)
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="DateTime"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="DateTime"/></returns>
public DateTime GetValue()
{
var timeSpan = this.latestDate.Subtract(this.earliestDate);
Expand All @@ -77,9 +77,9 @@ public DateTime GetValue()
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="Nullable{DateTime}"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="Nullable{DateTime}"/></returns>
DateTime? IRandomizerPlugin<DateTime?>.GetValue()
{
return this.GetValue();
Expand Down
20 changes: 10 additions & 10 deletions Tynamix.ObjectFiller/Plugins/Double/DoubleRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,39 @@ public DoubleRange()
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="double"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="double"/></returns>
public double GetValue()
{
return Random.NextDouble() * Math.Abs(this.maxValue - this.minValue) + this.minValue;
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="Nullable{Double}"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="Nullable{Double}"/></returns>
double? IRandomizerPlugin<double?>.GetValue()
{
return this.GetValue();
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="decimal"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="decimal"/></returns>
decimal IRandomizerPlugin<decimal>.GetValue()
{
return (decimal)GetValue();
return (decimal)this.GetValue();
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="Nullable{Decimal}"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="Nullable{Decimal}"/></returns>
decimal? IRandomizerPlugin<decimal?>.GetValue()
{
return (decimal)GetValue();
return (decimal)this.GetValue();
}
}
}
11 changes: 11 additions & 0 deletions Tynamix.ObjectFiller/Plugins/Double/FloatRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ namespace Tynamix.ObjectFiller
{
using System;

/// <summary>
/// Randomizer for type <see cref="float"/>
/// </summary>
public class FloatRange : IRandomizerPlugin<float>, IRandomizerPlugin<float?>
{
private readonly float _minValue;
Expand Down Expand Up @@ -37,13 +40,21 @@ public FloatRange()

}

/// <summary>
/// Gets random data for type <see cref="float"/>
/// </summary>
/// <returns>Random data for type <see cref="float"/></returns>
public float GetValue()
{
var value = Random.NextDouble();

return Convert.ToSingle(value) * (this._maxValue - this._minValue) + this._minValue;
}

/// <summary>
/// Gets random data for type <see cref="Nullable{Float}"/>
/// </summary>
/// <returns>Random data for type <see cref="Nullable{Float}"/></returns>
float? IRandomizerPlugin<float?>.GetValue()
{
return this.GetValue();
Expand Down
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/EnumeratorPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public EnumeratorPlugin(IEnumerable<T> enumerable)
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <typeparamref name="T"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <typeparamref name="T"/></returns>
public T GetValue()
{
// First time?
Expand Down
6 changes: 3 additions & 3 deletions Tynamix.ObjectFiller/Plugins/IRandomizerPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
namespace Tynamix.ObjectFiller
{
/// <summary>
/// Implement this interface to create a custom randomizer of type <see cref="T"/>
/// Implement this interface to create a custom randomizer of type <typeparamref name="T"/>
/// </summary>
/// <typeparam name="T">Type for which the randomizer will generate data</typeparam>
public interface IRandomizerPlugin<out T>
{
/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <typeparamref name="T"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <typeparamref name="T"/></returns>
T GetValue();
}
}
11 changes: 6 additions & 5 deletions Tynamix.ObjectFiller/Plugins/Integer/IntRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,22 @@ public IntRange()
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="int"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="int"/></returns>
public int GetValue()
{
return Random.Next(this.min, this.max);
}


/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="Nullable{Int32}"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="Nullable{Int32}"/></returns>
int? IRandomizerPlugin<int?>.GetValue()
{
return GetValue();
return this.GetValue();
}
}
}
12 changes: 6 additions & 6 deletions Tynamix.ObjectFiller/Plugins/List/Collectionizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ public Collectionizer(TRandomizer randomizerToUse, uint minCount, uint maxCount)


/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <typeparamref name="T"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <typeparamref name="T"/></returns>
public List<T> GetValue()
{
var count = Randomizer<int>.Create(new IntRange(this.minCount, this.maxCount));
Expand All @@ -112,19 +112,19 @@ public List<T> GetValue()
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <typeparamref name="T"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <typeparamref name="T"/></returns>
T[] IRandomizerPlugin<T[]>.GetValue()
{
return this.GetValue().ToArray();
}

#if !NETSTANDARD1_0
/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <typeparamref name="T"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <typeparamref name="T"/></returns>
ArrayList IRandomizerPlugin<ArrayList>.GetValue()
{
ArrayList arrayList = new ArrayList();
Expand Down
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/RandomListItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public RandomListItem(IEnumerable<T> allAvailableValues)
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <typeparamref name="T"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <typeparamref name="T"/></returns>
public T GetValue()
{
int rndmListIndex = Random.Next(0, this.allAvailableValues.Length);
Expand Down
2 changes: 2 additions & 0 deletions Tynamix.ObjectFiller/Plugins/SequenceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Tynamix.ObjectFiller
{
#region SequenceGeneratorSByte
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

public class SequenceGeneratorSByte : IRandomizerPlugin<SByte>
{
Expand Down Expand Up @@ -696,4 +697,5 @@ public DateTime GetValue()
}

#endregion
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
}
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/String/CityName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ static CityName()
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="string"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type<see cref="string"/></returns>
public string GetValue()
{
var index = Random.Next(AllCityNames.Count - 1);
Expand Down
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/String/CountryName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ static CountryName()
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="string"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="string"/></returns>
public string GetValue()
{
var index = Random.Next(AllCountryNames.Count - 1);
Expand Down
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/String/EmailAddresses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public EmailAddresses(IRandomizerPlugin<string> localPartSource, IRandomizerPlug
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="string"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="string"/></returns>
public string GetValue()
{
var localPart = this.GetLocalPart();
Expand Down
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/String/Lipsum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ public Lipsum(LipsumFlavor lipsumFlavor, int minWords = 10, int maxWords = 50, i
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="string"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="string"/></returns>
public string GetValue()
{
if (this.seed.HasValue)
Expand Down
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/String/MnemonicString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public MnemonicString(int wordCount, int wordMinLength, int wordMaxLength)
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="string"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="string"/></returns>
public string GetValue()
{
char[] vowels = { 'a', 'e', 'i', 'o', 'u' };
Expand Down
4 changes: 4 additions & 0 deletions Tynamix.ObjectFiller/Plugins/String/PatternGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ public string GetValue()
/// </summary>
public interface IExpressionGenerator
{
/// <summary>
/// Appends the given <paramref name="sb"/>
/// </summary>
/// <param name="sb">StringBuilder to append</param>
void AppendNextValue(StringBuilder sb);
}

Expand Down
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/String/RealNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ public RealNames(NameStyle nameStyle)
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="string"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="string"/></returns>
public string GetValue()
{
if (this.nameStyle == NameStyle.FirstNameLastName || this.nameStyle == NameStyle.LastNameFirstName)
Expand Down
4 changes: 2 additions & 2 deletions Tynamix.ObjectFiller/Plugins/String/StreetName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public StreetName(City targetCity)
}

/// <summary>
/// Gets random data for type <see cref="T"/>
/// Gets random data for type <see cref="string"/>
/// </summary>
/// <returns>Random data for type <see cref="T"/></returns>
/// <returns>Random data for type <see cref="string"/></returns>
public string GetValue()
{
var index = Random.Next(this.AllStreetNames.Count - 1);
Expand Down
9 changes: 3 additions & 6 deletions Tynamix.ObjectFiller/Random.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ internal static int Next()
}

/// <summary>
/// Returns a nonnegative number less than specified <see cref="maxValue"/>
/// Returns a nonnegative number less than specified <paramref name="maxValue"/>
/// </summary>
/// <param name="maxValue">
/// The maximum value.
/// </param>
/// <returns>
/// A nonnegative number less than specified <see cref="maxValue"/>
/// A nonnegative number less than specified <paramref name="maxValue"/>
/// </returns>
internal static int Next(int maxValue)
{
Expand Down Expand Up @@ -130,7 +130,7 @@ internal static void NextByte(byte[] buffer)
/// </summary>
/// <param name="min">Min long value</param>
/// <param name="max">Max long value</param>
/// <returns>A Long between <see cref="min"/> and <see cref="max"/></returns>
/// <returns>A Long between <paramref name="min"/> and <paramref name="max"/></returns>
internal static long NextLong(long min, long max)
{
long longRand = NextLong();
Expand All @@ -140,9 +140,6 @@ internal static long NextLong(long min, long max)
/// <summary>
/// Gets a random value between to source long values
/// </summary>
/// <param name="min">Min long value</param>
/// <param name="max">Max long value</param>
/// <returns>A Long between <see cref="min"/> and <see cref="max"/></returns>
internal static long NextLong()
{
byte[] buf = new byte[8];
Expand Down
Loading