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.
31 lines
715 B
C#
31 lines
715 B
C#
using Xunit;
|
|
|
|
using Radzen.Documents.Spreadsheet;
|
|
namespace Radzen.Blazor.Spreadsheet.Tests;
|
|
|
|
public class IntFunctionTests
|
|
{
|
|
readonly Worksheet sheet = new(10, 10);
|
|
|
|
[Fact]
|
|
public void ShouldRoundDownPositive()
|
|
{
|
|
sheet.Cells["A1"].Formula = "=INT(8.9)";
|
|
Assert.Equal(8d, sheet.Cells["A1"].Value);
|
|
}
|
|
|
|
[Fact]
|
|
public void ShouldRoundDownNegative()
|
|
{
|
|
sheet.Cells["A1"].Formula = "=INT(0-8.9)";
|
|
Assert.Equal(-9d, sheet.Cells["A1"].Value);
|
|
}
|
|
|
|
[Fact]
|
|
public void ShouldReturnDecimalPart()
|
|
{
|
|
sheet.Cells["A2"].Value = 19.5;
|
|
sheet.Cells["A1"].Formula = "=A2-INT(A2)";
|
|
Assert.Equal(0.5, sheet.Cells["A1"].Value);
|
|
}
|
|
} |