返回提交历史
Modified
README.md
+32
-8
Modified
XFE各类拓展.NetCore.XUnit/XFE各类拓展.NetCore.XUnit.csproj
+2
-2
XFEstudio/XFEExtension.NetCore.XUnit
编辑README和编辑文件版本
e58e03f
代码差异
2 个文件
+34
-10
@@ -6,7 +6,7 @@ XUnit测试框架,使得用户不需要编写Main函数,只需要在需要
6
6
7
7
## 示例
8
8
9
#### 快速编写无参测试用例(CTest和MTest)
9
### 快速编写无参测试用例(CTest和MTest)
10
10
11
11
```csharp
12
12
using XFE各类拓展.NetCore.XUnit;
@@ -27,8 +27,9 @@ public class TestClass
27
27
}
28
28
```
29
29
30
---
30
31
31
#### 带参数的测试用例
32
### 带参数的测试用例
32
33
33
34
```csharp
34
35
using XFE各类拓展.NetCore.XUnit;
@@ -46,8 +47,9 @@ public class TestClass
46
47
}
47
48
```
48
49
50
---
49
51
50
#### 使用断言(通过继承类)
52
### 使用断言(通过继承类)
51
53
52
54
```csharp
53
55
using XFE各类拓展.NetCore.XUnit;
@@ -64,8 +66,9 @@ public class TestClass : XFECode
64
66
}
65
67
```
66
68
69
---
67
70
68
#### 使用断言(不继承)
71
### 使用断言(不继承)
69
72
70
73
```csharp
71
74
using XFE各类拓展.NetCore.XUnit;
@@ -82,8 +85,9 @@ public class TestClass
82
85
}
83
86
```
84
87
88
---
85
89
86
#### 判断返回值是否相等(MRTest)
90
### 判断返回值是否相等(MRTest)
87
91
88
92
```csharp
89
93
using XFE各类拓展.NetCore.XUnit;
@@ -101,8 +105,9 @@ public class TestClass
101
105
}
102
106
```
103
107
108
---
104
109
105
#### 为测试用例添加描述(CNTest和MNTest)
110
### 为测试用例添加描述(CNTest和MNTest)
106
111
107
112
```csharp
108
113
using XFE各类拓展.NetCore.XUnit;
@@ -118,8 +123,9 @@ public class TestClass
118
123
}
119
124
```
120
125
126
---
121
127
122
#### 同时添加描述和结果对比(MNRTest)
128
### 同时添加描述和结果对比(MNRTest)
123
129
124
130
```csharp
125
131
using XFE各类拓展.NetCore.XUnit;
@@ -135,8 +141,9 @@ public class TestClass
135
141
}
136
142
```
137
143
144
---
138
145
139
#### 设置测试类的初始化方法(SetUp)
146
### 设置测试类的初始化方法(SetUp)
140
147
141
148
```csharp
142
149
using XFE各类拓展.NetCore.XUnit;
@@ -157,4 +164,21 @@ public class TestClass
157
164
Console.WriteLine(initWord);
158
165
}
159
166
}
167
```
168
169
---
170
171
### 直接测试静态方法(SMTest)
172
173
```csharp
174
using XFE各类拓展.NetCore.XUnit;
175
176
public class TestClass
177
{
178
[SMTest]
179
public static void TestMethod()
180
{
181
Console.WriteLine("Hello World!");
182
}
183
}
160
184
```
@@ -14,7 +14,7 @@
14
14
<PackageReadmeFile>README.md</PackageReadmeFile>
15
15
<RepositoryUrl>https://github.com/XFEstudio/XFEExtension.NetCore.XUnit</RepositoryUrl>
16
16
<PackageTags>XFE;Test;XUnit;Unit</PackageTags>
17
<Version>1.0.4</Version>
17
<Version>1.0.5</Version>
18
18
<PackageLicenseFile>LICENSE</PackageLicenseFile>
19
19
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
20
20
</PropertyGroup>
@@ -37,7 +37,7 @@
37
37
</ItemGroup>
38
38
39
39
<ItemGroup>
40
<PackageReference Include="XFE各类拓展.NetCore" Version="1.5.2" />
40
<PackageReference Include="XFE各类拓展.NetCore" Version="1.5.3" />
41
41
</ItemGroup>
42
42
43
43
</Project>