Web: Tests: Added opportunity to save dublicates test data

This commit is contained in:
Alexey Safronov 2021-05-24 17:40:29 +03:00
parent c652209b49
commit 0136c3933a

View File

@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
@ -111,6 +112,20 @@ namespace Frontend.Translations.Tests
.OrderByDescending(itm => itm.Count)
.ToList();
/*var listForSave = allDuplicates
.SelectMany(g => g.Grouped)
.GroupBy(item => item.Key)
.Select(grp => new
{
Key = grp.Key,
Value = grp.FirstOrDefault().Value
});
string json = JsonSerializer.Serialize(listForSave);
json = json.Replace("\"Key\":", "").Replace(",\"Value\"", "").Replace("},{", ",");
json = json.Substring(1, json.Length - 2);
File.WriteAllText(@"D:\dublicates.json", json);*/
Assert.AreEqual(0, allDuplicates.Count);
}