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.
33 lines
684 B
C#
33 lines
684 B
C#
using Xunit;
|
|
|
|
using Radzen.Documents.Spreadsheet;
|
|
namespace Radzen.Blazor.Spreadsheet.Tests;
|
|
|
|
public class TruncFunctionTests
|
|
{
|
|
readonly Worksheet sheet = new(10, 10);
|
|
|
|
[Fact]
|
|
public void ShouldTruncatePositive()
|
|
{
|
|
sheet.Cells["A1"].Formula = "=TRUNC(8.9)";
|
|
Assert.Equal(8d, sheet.Cells["A1"].Value);
|
|
}
|
|
|
|
[Fact]
|
|
public void ShouldTruncateNegative()
|
|
{
|
|
sheet.Cells["A1"].Formula = "=TRUNC(0-8.9)";
|
|
Assert.Equal(-8d, sheet.Cells["A1"].Value);
|
|
}
|
|
|
|
[Fact]
|
|
public void ShouldTruncateLessThanOne()
|
|
{
|
|
sheet.Cells["A1"].Formula = "=TRUNC(0.45)";
|
|
Assert.Equal(0d, sheet.Cells["A1"].Value);
|
|
}
|
|
}
|
|
|
|
|