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

27 lines
791 B
C#

using Xunit;
using Radzen.Blazor.Spreadsheet;
using Radzen.Documents.Spreadsheet;
namespace Radzen.Blazor.Spreadsheet.Tests;
public class TodayFunctionTests
{
[Fact]
public void Today_ReturnsCurrentDate()
{
var sheet = new Worksheet(10, 10);
sheet.Cells["A1"].Formula = "=TODAY()";
var dt = sheet.Cells["A1"].Data.GetValueOrDefault<System.DateTime>();
Assert.Equal(System.DateTime.Today.Date, dt.Date);
}
[Fact]
public void Today_PlusFiveDays()
{
var sheet = new Worksheet(10, 10);
sheet.Cells["A1"].Formula = "=TODAY()+5";
var serial = sheet.Cells["A1"].Data.GetValueOrDefault<double>();
var expected = System.DateTime.Today.AddDays(5).ToNumber();
Assert.Equal(expected, serial);
}
}