Skip to content

Commit d3980ae

Browse files
committed
test: 增加单元测试
1 parent fb2c14d commit d3980ae

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/UnitTest/Options/BootstrapBlazorOptionsTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,19 @@ public void Options_TableExportOptions()
103103

104104
Assert.Equal(",", exportOptions.ArrayDelimiter);
105105
}
106+
107+
[Fact]
108+
public void CacheManagerOptions_Ok()
109+
{
110+
var options = new BootstrapBlazorOptions();
111+
Assert.NotNull(options.CacheManagerOptions);
112+
113+
options.CacheManagerOptions.Enable = true;
114+
options.CacheManagerOptions.SlidingExpiration = TimeSpan.FromSeconds(1);
115+
options.CacheManagerOptions.AbsoluteExpiration = TimeSpan.FromSeconds(1);
116+
117+
Assert.Equal(TimeSpan.FromSeconds(1), options.CacheManagerOptions.AbsoluteExpiration);
118+
Assert.Equal(TimeSpan.FromSeconds(1), options.CacheManagerOptions.SlidingExpiration);
119+
Assert.True(options.CacheManagerOptions.Enable);
120+
}
106121
}

0 commit comments

Comments
 (0)