mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-07-08 18:16:08 +00:00
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.
42 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|
|
|
|
|