Skip to content

Commit d3a54b9

Browse files
committed
test: 增加单元测试
1 parent 0ce46c2 commit d3a54b9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/UnitTest/Components/FileIconTest.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,33 @@ public void BackgroundTemplate_Ok()
3939
});
4040
cut.Contains("test-content");
4141
}
42+
43+
[Theory]
44+
[InlineData(Size.ExtraSmall)]
45+
[InlineData(Size.Small)]
46+
[InlineData(Size.Medium)]
47+
[InlineData(Size.Large)]
48+
[InlineData(Size.ExtraLarge)]
49+
[InlineData(Size.ExtraExtraLarge)]
50+
public void Size_Ok(Size size)
51+
{
52+
var cut = Context.RenderComponent<FileIcon>(pb =>
53+
{
54+
pb.Add(a => a.Extension, ".xlsx");
55+
pb.Add(a => a.Size, size);
56+
});
57+
cut.Contains($"file-icon file-icon-{size.ToDescriptionString()}");
58+
}
59+
60+
[Fact]
61+
public void Size_None()
62+
{
63+
var cut = Context.RenderComponent<FileIcon>(pb =>
64+
{
65+
pb.Add(a => a.Extension, ".xlsx");
66+
pb.Add(a => a.Size, Size.None);
67+
});
68+
cut.Contains("file-icon");
69+
cut.DoesNotContain("file-icon-none");
70+
}
4271
}

0 commit comments

Comments
 (0)