Skip to content

Commit 90d32a8

Browse files
committed
Added methods for testing Controller and ViewComponent attributes (#34)
1 parent dc96a4f commit 90d32a8

19 files changed

+674
-313
lines changed

docs/_docfx/api/.manifest

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IActionAttributesTestBuilder.html

Lines changed: 9 additions & 150 deletions
Large diffs are not rendered by default.

docs/api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.html

Lines changed: 134 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969

7070
<h1 id="MyTested_AspNetCore_Mvc_Builders_Contracts_Attributes_IBaseAttributesTestBuilder_1" data-uid="MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder`1">Interface IBaseAttributesTestBuilder&lt;TAttributesTestBuilder&gt;
7171
</h1>
72-
<div class="markdown level0 summary"></div>
72+
<div class="markdown level0 summary"><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="2" sourceendlinenumber="2">Base interface for all attribute test builders.</p>
73+
</div>
7374
<div class="markdown level0 conceptual"></div>
7475
<h6><strong>Namespace</strong>:MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes</h6>
7576
<h6><strong>Assembly</strong>:MyTested.AspNetCore.Mvc.Abstractions.dll</h6>
@@ -88,7 +89,7 @@ <h5 class="typeParameters">Type Parameters</h5>
8889
<tbody>
8990
<tr>
9091
<td><em>TAttributesTestBuilder</em></td>
91-
<td></td>
92+
<td>Type of attributes test builder to use as a return type for common methods.</td>
9293
</tr>
9394
</tbody>
9495
</table>
@@ -99,10 +100,10 @@ <h3 id="methods">Methods
99100
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/new/lite-package/docs/_docfx/apispec/new?filename=MyTested_AspNetCore_Mvc_Builders_Contracts_Attributes_IBaseAttributesTestBuilder_1_ContainingAttributeOfType__1.md&amp;value=---%0Auid%3A%20MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder%601.ContainingAttributeOfType%60%601%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
100101
</span>
101102
<span class="small pull-right mobile-hide">
102-
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/blob/lite-package/src/MyTested.AspNetCore.Mvc.Abstractions/Builders/Contracts/Attributes/IBaseAttributesTestBuilder.cs/#L12">View Source</a>
103+
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/blob/lite-package/src/MyTested.AspNetCore.Mvc.Abstractions/Builders/Contracts/Attributes/IBaseAttributesTestBuilder.cs/#L16">View Source</a>
103104
</span>
104105
<h4 id="MyTested_AspNetCore_Mvc_Builders_Contracts_Attributes_IBaseAttributesTestBuilder_1_ContainingAttributeOfType__1" data-uid="MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder`1.ContainingAttributeOfType``1">ContainingAttributeOfType&lt;TAttribute&gt;()</h4>
105-
<div class="markdown level1 summary"><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="2" sourceendlinenumber="2">Checks whether the collected attributes contain the provided attribute type.</p>
106+
<div class="markdown level1 summary"><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="2" sourceendlinenumber="2">Tests whether the collected attributes contain the provided attribute type.</p>
106107
</div>
107108
<div class="markdown level1 conceptual"></div>
108109
<h5 class="decalaration">Declaration</h5>
@@ -121,6 +122,134 @@ <h5 class="returns">Returns</h5>
121122
<tr>
122123
<td><span class="xref">TAttributesTestBuilder</span></td>
123124
<td><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="1" sourceendlinenumber="1">The same attributes test builder.</p>
125+
</td>
126+
</tr>
127+
</tbody>
128+
</table>
129+
<h5 class="typeParameters">Type Parameters</h5>
130+
<table class="table table-bordered table-striped table-condensed">
131+
<thead>
132+
<tr>
133+
<th>Name</th>
134+
<th>Description</th>
135+
</tr>
136+
</thead>
137+
<tbody>
138+
<tr>
139+
<td><em>TAttribute</em></td>
140+
<td>Type of expected attribute.</td>
141+
</tr>
142+
</tbody>
143+
</table>
144+
<span class="small pull-right mobile-hide">
145+
<span class="divider">|</span>
146+
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/new/lite-package/docs/_docfx/apispec/new?filename=MyTested_AspNetCore_Mvc_Builders_Contracts_Attributes_IBaseAttributesTestBuilder_1_PassingFor__1_System_Action___0__.md&amp;value=---%0Auid%3A%20MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder%601.PassingFor%60%601(System.Action%7B%60%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
147+
</span>
148+
<span class="small pull-right mobile-hide">
149+
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/blob/lite-package/src/MyTested.AspNetCore.Mvc.Abstractions/Builders/Contracts/Attributes/IBaseAttributesTestBuilder.cs/#L25">View Source</a>
150+
</span>
151+
<h4 id="MyTested_AspNetCore_Mvc_Builders_Contracts_Attributes_IBaseAttributesTestBuilder_1_PassingFor__1_System_Action___0__" data-uid="MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder`1.PassingFor``1(System.Action{``0})">PassingFor&lt;TAttribute&gt;(Action&lt;TAttribute&gt;)</h4>
152+
<div class="markdown level1 summary"><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="2" sourceendlinenumber="2">Tests whether the collected attributes contain the provided attribute type passing the given assertions.</p>
153+
</div>
154+
<div class="markdown level1 conceptual"></div>
155+
<h5 class="decalaration">Declaration</h5>
156+
<div class="codewrapper">
157+
<pre><code class="lang-csharp hljs">TAttributesTestBuilder PassingFor&lt;TAttribute&gt;(Action&lt;TAttribute&gt; assertions)where TAttribute : Attribute</code></pre>
158+
</div>
159+
<h5 class="parameters">Parameters</h5>
160+
<table class="table table-bordered table-striped table-condensed">
161+
<thead>
162+
<tr>
163+
<th>Type</th>
164+
<th>Name</th>
165+
<th>Description</th>
166+
</tr>
167+
</thead>
168+
<tbody>
169+
<tr>
170+
<td><span class="xref">System.Action</span>&lt;TAttribute&gt;</td>
171+
<td><em>assertions</em></td>
172+
<td><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="1" sourceendlinenumber="1">Action containing assertions on the provided attribute.</p>
173+
</td>
174+
</tr>
175+
</tbody>
176+
</table>
177+
<h5 class="returns">Returns</h5>
178+
<table class="table table-bordered table-striped table-condensed">
179+
<thead>
180+
<tr>
181+
<th>Type</th>
182+
<th>Description</th>
183+
</tr>
184+
</thead>
185+
<tbody>
186+
<tr>
187+
<td><span class="xref">TAttributesTestBuilder</span></td>
188+
<td><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="1" sourceendlinenumber="1">The same attributes test builder.</p>
189+
</td>
190+
</tr>
191+
</tbody>
192+
</table>
193+
<h5 class="typeParameters">Type Parameters</h5>
194+
<table class="table table-bordered table-striped table-condensed">
195+
<thead>
196+
<tr>
197+
<th>Name</th>
198+
<th>Description</th>
199+
</tr>
200+
</thead>
201+
<tbody>
202+
<tr>
203+
<td><em>TAttribute</em></td>
204+
<td>Type of expected attribute.</td>
205+
</tr>
206+
</tbody>
207+
</table>
208+
<span class="small pull-right mobile-hide">
209+
<span class="divider">|</span>
210+
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/new/lite-package/docs/_docfx/apispec/new?filename=MyTested_AspNetCore_Mvc_Builders_Contracts_Attributes_IBaseAttributesTestBuilder_1_PassingFor__1_System_Func___0_System_Boolean__.md&amp;value=---%0Auid%3A%20MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder%601.PassingFor%60%601(System.Func%7B%60%600%2CSystem.Boolean%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
211+
</span>
212+
<span class="small pull-right mobile-hide">
213+
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/blob/lite-package/src/MyTested.AspNetCore.Mvc.Abstractions/Builders/Contracts/Attributes/IBaseAttributesTestBuilder.cs/#L34">View Source</a>
214+
</span>
215+
<h4 id="MyTested_AspNetCore_Mvc_Builders_Contracts_Attributes_IBaseAttributesTestBuilder_1_PassingFor__1_System_Func___0_System_Boolean__" data-uid="MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder`1.PassingFor``1(System.Func{``0,System.Boolean})">PassingFor&lt;TAttribute&gt;(Func&lt;TAttribute, Boolean&gt;)</h4>
216+
<div class="markdown level1 summary"><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="2" sourceendlinenumber="2">Tests whether the collected attributes contain the provided attribute type passing the given predicate.</p>
217+
</div>
218+
<div class="markdown level1 conceptual"></div>
219+
<h5 class="decalaration">Declaration</h5>
220+
<div class="codewrapper">
221+
<pre><code class="lang-csharp hljs">TAttributesTestBuilder PassingFor&lt;TAttribute&gt;(Func&lt;TAttribute, bool&gt; predicate)where TAttribute : Attribute</code></pre>
222+
</div>
223+
<h5 class="parameters">Parameters</h5>
224+
<table class="table table-bordered table-striped table-condensed">
225+
<thead>
226+
<tr>
227+
<th>Type</th>
228+
<th>Name</th>
229+
<th>Description</th>
230+
</tr>
231+
</thead>
232+
<tbody>
233+
<tr>
234+
<td><span class="xref">System.Func</span>&lt;TAttribute, <span class="xref">System.Boolean</span>&gt;</td>
235+
<td><em>predicate</em></td>
236+
<td><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="1" sourceendlinenumber="1">Predicate testing the provided attribute.</p>
237+
</td>
238+
</tr>
239+
</tbody>
240+
</table>
241+
<h5 class="returns">Returns</h5>
242+
<table class="table table-bordered table-striped table-condensed">
243+
<thead>
244+
<tr>
245+
<th>Type</th>
246+
<th>Description</th>
247+
</tr>
248+
</thead>
249+
<tbody>
250+
<tr>
251+
<td><span class="xref">TAttributesTestBuilder</span></td>
252+
<td><p sourcefile="api/MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder-1.yml" sourcestartlinenumber="1" sourceendlinenumber="1">The same attributes test builder.</p>
124253
</td>
125254
</tr>
126255
</tbody>
@@ -151,7 +280,7 @@ <h5 class="typeParameters">Type Parameters</h5>
151280
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/new/lite-package/docs/_docfx/apispec/new?filename=MyTested_AspNetCore_Mvc_Builders_Contracts_Attributes_IBaseAttributesTestBuilder_1.md&amp;value=---%0Auid%3A%20MyTested.AspNetCore.Mvc.Builders.Contracts.Attributes.IBaseAttributesTestBuilder%601%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
152281
</li>
153282
<li>
154-
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/blob/lite-package/src/MyTested.AspNetCore.Mvc.Abstractions/Builders/Contracts/Attributes/IBaseAttributesTestBuilder.cs/#L5" class="contribution-link">View Source</a>
283+
<a href="https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/blob/lite-package/src/MyTested.AspNetCore.Mvc.Abstractions/Builders/Contracts/Attributes/IBaseAttributesTestBuilder.cs/#L9" class="contribution-link">View Source</a>
155284
</li>
156285
</ul>
157286
</div>

0 commit comments

Comments
 (0)