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.
27 lines
791 B
C#
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);
|
|
}
|
|
} |