Files
andy 9f22b522df v1.3.0 Restructure Saxonite workspace and upgrade to .NET 10 (#1)
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>
2026-10-16 18:24:16 +01:00

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 &amp; 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 &amp; 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>"));
}
}
//=======================================================================
}