This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 合并请求( Pull Request ) >标题格式:【新增|修复|移除|更新】摘要描述 ### 关于本次更新的主要内容 > 请详细描述,描述得越详细,评审通过的几率就越高 ### 本次合并的类型是什么? - [ ] 缺陷修复(对缺陷的修复,包括紧急修复和一般修复) - [ ] 功能开发(新功能、特性的开发,之前功能的完善等) - [ ] 代码风格(包括命名规范、格式、优化代码的写法等) - [ ] 文档更新(仅对当前版本的文档进行增加、完善和更新) - [ ] 重构(没有新功能,仅对代码的重构、调整) - [x] 测试(单元测试、集成测试、性能测试、压力测试等) - [ ] DevOps (CI/CD、git action 等) - [ ] 其他,请在下面进行描述: > 其他描述写在这里 ### 关联的 ISSUE 编号 ISSUE 编号: ### 合并请求的必要条件 - [ ]必要的单元测试已经完成 - [ ]完成必要的注释,包括参数、方法、属性、类等 - [ ]代码风格必须符合 C# 的代码规范 ### 期望参与合并请求评审的成员 使用 `@名字`来提及你期望参与本次评审人成员 ### 其他相关信息 <!--如果有,请写明--> > **非常感谢您对本项目的贡献,所有的合并请求最终将由作者通过才可以合并成功。并且要求贡献者需要谦虚地对待每一次评审的内容,并且尊重每一位贡献者的回复。良好的规范才能让项目健康的运转,保持利他精神才是我们一直信奉的价值观。**
- Loading branch information
Showing
4 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using ComponentBuilder; | ||
|
||
namespace TDesignBlazor.Test.Components; | ||
public class DividerTest : TestBase<Divider> | ||
{ | ||
[Fact(DisplayName = "Divider - 默认样式的渲染")] | ||
public void Test_Render_With_Default_Class() | ||
{ | ||
GetComponent().Should().HaveTag("div").And.HaveClass("t-divider"); | ||
} | ||
|
||
[Fact(DisplayName = "Divider - Vertical 参数")] | ||
public void Test_Vertical_Parameter() | ||
{ | ||
GetComponent(m => m.Add(p => p.Vertical, true)).Should().HaveClass("t-divider--vertical"); | ||
} | ||
|
||
[Fact(DisplayName = "Divider - Dashed 参数")] | ||
public void Test_Dashed_Parameter() | ||
{ | ||
GetComponent(m => m.Add(p => p.Dashed, true)).Should().HaveClass("t-divider--dashed"); | ||
} | ||
|
||
[Theory(DisplayName = "Divider - Alighment 参数")] | ||
[InlineData(new object[] { HorizontalAlignment.Left })] | ||
[InlineData(new object[] { HorizontalAlignment.Center })] | ||
[InlineData(new object[] { HorizontalAlignment.Right })] | ||
public void Test_Alignment_Parameter(HorizontalAlignment alignment) | ||
{ | ||
GetComponent(m => m.Add(p => p.Alignment, alignment)).Should().HaveClass($"t-divider--with-text-{alignment.GetCssClass()}"); | ||
} | ||
|
||
[Fact(DisplayName = "Divider - ChildContent 赋值后会嵌套一层")] | ||
public void Test_ChildContent_Has_Inner_Span() | ||
{ | ||
GetComponent(m => m.AddChildContent("test")).Should().HaveChildMarkup("<span class=\"t-divider__inner-text\">test</span>") | ||
.And.HaveClass("t-divider--with-text"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters