Files
radzen-blazor/Radzen.Blazor.Tests/Spreadsheet/TruncFunctionTests.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

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);
}
}