-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ Random Service Builder with extension methods; + ITypedRandomizer<T>; + INumberRandomizer<T>; + IArrayRandomizer<T>; + Cleaning for tests; + Cleaning for benchmarks;
- Loading branch information
1 parent
a7a0c4d
commit 923b4f6
Showing
91 changed files
with
1,778 additions
and
1,280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright © 2022 Nikolay Melnikov. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
namespace Depra.Random.Application.UnitTests.Helpers; | ||
|
||
internal static class ConsoleHelper | ||
{ | ||
public static void PrintCollection<T>(IEnumerable<T> collection) | ||
{ | ||
foreach (var element in collection) | ||
{ | ||
Console.WriteLine(element); | ||
} | ||
} | ||
|
||
public static void PrintRandomizeResultForCollection<T>(IEnumerable<T> collection, T minInclusive, | ||
T maxExclusive) | ||
{ | ||
Console.WriteLine($"minInclusive: {minInclusive}\n" + | ||
$"maxExclusive: {maxExclusive}\n"); | ||
|
||
PrintCollection(collection); | ||
} | ||
|
||
public static void PrintBytes(IEnumerable<byte> bytes) | ||
{ | ||
foreach (var @byte in bytes) | ||
{ | ||
Console.Write(@byte + " "); | ||
} | ||
|
||
Console.WriteLine(); | ||
} | ||
|
||
public static void PrintRandomizeResultForBytes(IEnumerable<byte> bytes, byte minInclusive, byte maxExclusive) | ||
{ | ||
Console.WriteLine($"minInclusive: {minInclusive}\n" + | ||
$"maxExclusive: {maxExclusive}\n"); | ||
|
||
PrintBytes(bytes); | ||
} | ||
|
||
public static void PrintSBytes(IEnumerable<sbyte> bytes) | ||
{ | ||
foreach (var @byte in bytes) | ||
{ | ||
Console.Write(@byte + " "); | ||
} | ||
|
||
Console.WriteLine(); | ||
} | ||
|
||
public static void PrintRandomizeResultForSBytes(IEnumerable<sbyte> bytes, sbyte minInclusive, sbyte maxExclusive) | ||
{ | ||
Console.WriteLine($"minInclusive: {minInclusive}\n" + | ||
$"maxExclusive: {maxExclusive}\n"); | ||
|
||
PrintSBytes(bytes); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
Random.UnitTests/PseudoRandomTests.cs → ...pplication.UnitTests/PseudoRandomTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.