Skip to content

Commit

Permalink
Add logging to RTE integration tests to trace the source of the faili…
Browse files Browse the repository at this point in the history
…ng tests
  • Loading branch information
kjac committed Oct 28, 2024
1 parent 2edbd7d commit a66082a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
using Microsoft.Extensions.Logging;
using NUnit.Framework;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Blocks;
Expand Down Expand Up @@ -482,7 +483,9 @@ void AssertIndexedValues(string culture, params string[] expectedIndexedValues)
Assert.AreEqual(1, indexValue.Values.Count());
var indexedValue = indexValue.Values.First() as string;
Assert.IsNotNull(indexedValue);
GetRequiredService<ILogger<RichTextElementLevelVariationTests>>().LogInformation("==> Indexed value = \"{indexedValue}\"", indexedValue);
var values = indexedValue.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray();
GetRequiredService<ILogger<RichTextElementLevelVariationTests>>().LogInformation("===>> Indexed values parsed = \"{values}\"", string.Join("###", values));
Assert.AreEqual(expectedIndexedValues.Length, values.Length);
Assert.IsTrue(values.ContainsAll(expectedIndexedValues));
}
Expand Down Expand Up @@ -562,7 +565,9 @@ void AssertIndexedValues(string culture, params string[] expectedIndexedValues)
Assert.AreEqual(1, indexValue.Values.Count());
var indexedValue = indexValue.Values.First() as string;
Assert.IsNotNull(indexedValue);
GetRequiredService<ILogger<RichTextElementLevelVariationTests>>().LogInformation("==> Indexed value = \"{indexedValue}\"", indexedValue);
var values = indexedValue.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray();
GetRequiredService<ILogger<RichTextElementLevelVariationTests>>().LogInformation("===>> Indexed values parsed = \"{values}\"", string.Join("###", values));
Assert.AreEqual(expectedIndexedValues.Length, values.Length);
Assert.IsTrue(values.ContainsAll(expectedIndexedValues));
}
Expand Down Expand Up @@ -624,7 +629,9 @@ void AssertIndexedValues(string culture, params string[] expectedIndexedValues)
Assert.AreEqual(1, indexValue.Values.Count());
var indexedValue = indexValue.Values.First() as string;
Assert.IsNotNull(indexedValue);
GetRequiredService<ILogger<RichTextElementLevelVariationTests>>().LogInformation("==> Indexed value = \"{indexedValue}\"", indexedValue);
var values = indexedValue.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToArray();
GetRequiredService<ILogger<RichTextElementLevelVariationTests>>().LogInformation("===>> Indexed values parsed = \"{values}\"", string.Join("###", values));
Assert.AreEqual(expectedIndexedValues.Length, values.Length);
Assert.IsTrue(values.ContainsAll(expectedIndexedValues));
}
Expand Down

0 comments on commit a66082a

Please sign in to comment.