Skip to content

Commit

Permalink
Merge pull request #181 from glhays/users/glhays/coderub-problemdetai…
Browse files Browse the repository at this point in the history
…ls-errorfix

CODE RUB: Resolves Build Error ValidationServiceTests
  • Loading branch information
hassanhabib authored Sep 19, 2024
2 parents bc97e43 + 50945cf commit 229b2df
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
// See License.txt in the project root for license information.
// ---------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
Expand Down Expand Up @@ -1224,11 +1226,21 @@ private static ValidationProblemDetails CreateRandomProblemDetails()
return randomValidationProblemDetails;
}

private static string[] GetRandomStringArray()
{
var filler = new Filler<string>();

return Enumerable.Range(0, new Random().Next(minValue: 1, maxValue: 10))
.Select(selector: _ => filler.Create())
.ToArray();
}

private static Dictionary<string, string[]> CreateRandomErrorDictionary()
{
var filler = new Filler<Dictionary<string, string[]>>();

filler.Setup()
.OnType<string[]>().Use(GetRandomStringArray())
.DictionaryItemCount(maxCount: 10);

return filler.Create();
Expand Down

0 comments on commit 229b2df

Please sign in to comment.