Move Saxonite’s projects into a dedicated `Workspace` folder and align the solution with .NET 10 and the current Common workspace. Update encryption integration, test project structure and coverage, and repository guidance and upgrade notes. - Relocate application and library projects while retaining Git rename history. - Split tests into Admin, Online, and Shared projects; add representative behavioral and serialization tests. - Update Common integration, application version, and repository documentation. Application version: 1.3.0 Reviewed-on: #1 Co-authored-by: andy <andy@sarand.com>
42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using NUnit.Framework;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
using Saxonite.Net.Standard.Base.Bus;
|
|
|
|
namespace Saxonite.Net.Core.UnitTests.Data.Bus
|
|
{
|
|
//=======================================================================
|
|
[TestFixture]
|
|
public class SaxArticle_ContentData_Tester
|
|
{
|
|
//-------------------------------------------------------------------
|
|
[Test]
|
|
public void ContentDataRoundTripsBodyAndImageSegments()
|
|
{
|
|
SaxArticle.ContentData content = new SaxArticle.ContentData();
|
|
content.AddSegment().Body.Html = "<p>Fish & chips</p>";
|
|
content.AddSegment().Image.ItemImageId = new SysId(123);
|
|
|
|
SaxArticle.ContentData restored = SaxArticle.ExtractContent(SaxArticle.GetContentData(content));
|
|
|
|
Assert.That(restored.Segments, Has.Count.EqualTo(2));
|
|
Assert.That(restored.Segments[0].Body.Html, Is.EqualTo("<p>Fish & chips</p>"));
|
|
Assert.That(SysId.ToLong(restored.Segments[1].Image.ItemImageId), Is.EqualTo(123));
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
[Test]
|
|
public void ContentDataOmitsInvalidSegments()
|
|
{
|
|
SaxArticle.ContentData content = new SaxArticle.ContentData();
|
|
content.AddSegment();
|
|
content.AddSegment().Body.Html = "<p>Valid</p>";
|
|
|
|
SaxArticle.ContentData restored = SaxArticle.ExtractContent(SaxArticle.GetContentData(content));
|
|
|
|
Assert.That(restored.Segments, Has.Count.EqualTo(1));
|
|
Assert.That(restored.Segments[0].Body.Html, Is.EqualTo("<p>Valid</p>"));
|
|
}
|
|
}
|
|
//=======================================================================
|
|
}
|