Files
radzen-blazor/Radzen.Blazor.Tests/Spreadsheet/ColumnFunctionTests.cs
Atanas Korchev 622b24c4f1 Rename Sheet class to Worksheet
Matches Excel terminology, OpenXML spec, and industry convention
(Aspose, Telerik, Syncfusion all use Worksheet). Property names on
components remain Sheet for now; only the type name changes.
2026-06-15 18:45:03 +03:00

42 lines
1.1 KiB
C#

using Xunit;
using Radzen.Documents.Spreadsheet;
namespace Radzen.Blazor.Spreadsheet.Tests;
public class ColumnFunctionTests
{
[Fact]
public void Column_OmittedReference_ReturnsCurrentColumn()
{
var sheet = new Worksheet(20, 10);
sheet.Cells["C10"].Formula = "=COLUMN()";
Assert.Equal(3d, sheet.Cells["C10"].Data.Value);
}
[Fact]
public void Column_SingleCellReference_ReturnsThatColumn()
{
var sheet = new Worksheet(20, 10);
sheet.Cells["A1"].Formula = "=COLUMN(C10)";
Assert.Equal(3d, sheet.Cells["A1"].Data.Value);
}
[Fact]
public void Column_RangeReference_SingleRow_ReturnsLeftmostColumn()
{
var sheet = new Worksheet(20, 10);
sheet.Cells["B2"].Formula = "=COLUMN(C10:E10)";
Assert.Equal(3d, sheet.Cells["B2"].Data.Value);
}
[Fact]
public void Column_RangeReference_MultiRowAndColumn_IsError()
{
var sheet = new Worksheet(20, 10);
sheet.Cells["B2"].Formula = "=COLUMN(C10:D20)";
Assert.Equal(CellError.Value, sheet.Cells["B2"].Data.Value);
}
}