File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
src/BootstrapBlazor/Options Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ namespace BootstrapBlazor.Components;
88/// <summary>
99/// 页面边距选项
1010/// </summary>
11+ [ ExcludeFromCodeCoverage ]
1112public record MarginOptions
1213{
1314 /// <summary>
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ namespace BootstrapBlazor.Components;
88/// <summary>
99/// 纸张规格配置类
1010/// </summary>
11+ [ ExcludeFromCodeCoverage ]
1112public record PaperFormat
1213{
1314 /// <summary>
Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the Apache 2.0 License
3+ // See the LICENSE file in the project root for more information.
4+ // Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 5+
6+ namespace UnitTest . Options ;
7+
8+ public class PdfOptionsTest
9+ {
10+ [ Fact ]
11+ public void Test_PdfOptions_Ok ( )
12+ {
13+ var options = new PdfOptions ( )
14+ {
15+ Scale = 1.0m ,
16+ DisplayHeaderFooter = true ,
17+ PrintBackground = true ,
18+ Landscape = true ,
19+ Format = PaperFormat . A1 ,
20+ MarginOptions = new MarginOptions ( )
21+ {
22+ Top = "10mm" ,
23+ Bottom = "10mm" ,
24+ Left = "10mm" ,
25+ Right = "10mm"
26+ }
27+ } ;
28+ Assert . Equal ( 1.0m , options . Scale ) ;
29+ Assert . True ( options . DisplayHeaderFooter ) ;
30+ Assert . True ( options . PrintBackground ) ;
31+ Assert . True ( options . Landscape ) ;
32+ Assert . Equal ( PaperFormat . A1 , options . Format ) ;
33+ Assert . Equal ( "10mm" , options . MarginOptions . Top ) ;
34+ Assert . Equal ( "10mm" , options . MarginOptions . Bottom ) ;
35+ Assert . Equal ( "10mm" , options . MarginOptions . Left ) ;
36+ Assert . Equal ( "10mm" , options . MarginOptions . Right ) ;
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments