From 56da546678814513a3bd5d5b5850f5804d638834 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 6 Jan 2025 15:31:11 +0700 Subject: [PATCH] add UTs for TextDataField primitives --- .../Primitives/TextDataFieldFixture.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/Reveal.Sdk.Dom.Tests/Visualizations/Primitives/TextDataFieldFixture.cs diff --git a/src/Reveal.Sdk.Dom.Tests/Visualizations/Primitives/TextDataFieldFixture.cs b/src/Reveal.Sdk.Dom.Tests/Visualizations/Primitives/TextDataFieldFixture.cs new file mode 100644 index 00000000..b94599cc --- /dev/null +++ b/src/Reveal.Sdk.Dom.Tests/Visualizations/Primitives/TextDataFieldFixture.cs @@ -0,0 +1,34 @@ +using Reveal.Sdk.Dom.Core.Constants; +using Reveal.Sdk.Dom.Visualizations; +using Xunit; + +namespace Reveal.Sdk.Dom.Tests.Visualizations.Primitives +{ + public class TextDataFieldFixture + { + [Fact] + public void Constructor_SetsDefaultValues_WhenConstructedWithNoFieldName() + { + // Act + var band = new TextDataField(); + + // Assert + Assert.Equal(SchemaTypeNames.SummarizationRegularFieldType, band.SchemaTypeName); + Assert.Equal(string.Empty, band.FieldName); + } + + [Fact] + public void Constructor_SetsDefaultValues_WhenConstructedWithFieldName() + { + // Arrange + var fieldName = "TestFieldName"; + + // Act + var band = new TextDataField(fieldName); + + // Assert + Assert.Equal(SchemaTypeNames.SummarizationRegularFieldType, band.SchemaTypeName); + Assert.Equal(fieldName, band.FieldName); + } + } +}