Skip to content

Commit 8ef019f

Browse files
committed
Added documentation on every class in the main namespace (#193)
1 parent d8b88c8 commit 8ef019f

File tree

18 files changed

+165
-4
lines changed

18 files changed

+165
-4
lines changed

src/MyTested.AspNetCore.Mvc.Abstractions/MyApplication.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,38 @@
55
using Builders.Contracts.Application;
66
using Internal.Application;
77

8+
/// <summary>
9+
/// Provides methods to set up the ASP.NET Core MVC test application.
10+
/// </summary>
811
public class MyApplication : ApplicationConfigurationBuilder
912
{
1013
static MyApplication()
1114
{
1215
TestApplication.TryInitialize();
1316
}
14-
17+
18+
/// <summary>
19+
/// Initializes a new instance of the <see cref="MyApplication"/> class.
20+
/// </summary>
1521
public MyApplication()
1622
: this(null)
1723
{
1824
}
1925

26+
/// <summary>
27+
/// Initializes a new instance of the <see cref="MyApplication"/> class.
28+
/// </summary>
29+
/// <param name="startupType">Startup class to bootstrap the test application from.</param>
2030
public MyApplication(Type startupType)
2131
: base(startupType)
2232
{
2333
}
24-
34+
35+
/// <summary>
36+
/// Specifies the Startup class from which the test application is bootstrapped.
37+
/// </summary>
38+
/// <typeparam name="TStartup">Startup class to bootstrap the test application from.</typeparam>
39+
/// <returns>Builder of <see cref="IApplicationConfigurationBuilder"/> type.</returns>
2540
public static IApplicationConfigurationBuilder StartsFrom<TStartup>()
2641
where TStartup : class
2742
{

src/MyTested.AspNetCore.Mvc.Abstractions/ServiceCollectionAbstractionsExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
/// </summary>
1717
public static class ServiceCollectionAbstractionsExtensions
1818
{
19+
/// <summary>
20+
/// Adds core MVC testing services.
21+
/// </summary>
22+
/// <param name="serviceCollection">Instance of <see cref="IServiceCollection"/> type.</param>
23+
/// <returns>The same <see cref="IServiceCollection"/>.</returns>
1924
public static IServiceCollection AddCoreTesting(this IServiceCollection serviceCollection)
2025
{
2126
CommonValidator.CheckForNullReference(serviceCollection, nameof(serviceCollection));

src/MyTested.AspNetCore.Mvc.Authentication/HttpRequestBuilderAuthenticationExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
using Builders.Http;
77
using System;
88

9+
/// <summary>
10+
/// Contains authentication extension methods for <see cref="IHttpRequestBuilder"/>.
11+
/// </summary>
912
public static class HttpRequestBuilderAuthenticationExtensions
1013
{
1114
/// <summary>

src/MyTested.AspNetCore.Mvc.Controllers/ActionAttributes.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
using System.Collections.Generic;
55
using Utilities.Validators;
66

7+
/// <summary>
8+
/// Class used for specifying additional assertions on the action attributes.
9+
/// </summary>
710
public class ActionAttributes : IEnumerable<object>
811
{
912
private readonly IEnumerable<object> attributes;

src/MyTested.AspNetCore.Mvc.Controllers/ControllerAttributes.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
using System.Collections.Generic;
55
using Utilities.Validators;
66

7+
/// <summary>
8+
/// Class used for specifying additional assertions on the controller attributes.
9+
/// </summary>
710
public class ControllerAttributes : IEnumerable<object>
811
{
912
private readonly IEnumerable<object> attributes;

src/MyTested.AspNetCore.Mvc.Controllers/MyController.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
using Internal.Application;
77
using Internal.TestContexts;
88

9+
/// <summary>
10+
/// Provides methods to specify an ASP.NET Core MVC controller test case.
11+
/// </summary>
12+
/// <typeparam name="TController">Type of ASP.NET Core MVC controller to test.</typeparam>
913
public class MyController<TController> : ControllerBuilder<TController>
1014
where TController : class
1115
{
@@ -14,31 +18,56 @@ static MyController()
1418
TestApplication.TryInitialize();
1519
}
1620

21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="MyController{TController}"/> class.
23+
/// </summary>
1724
public MyController()
1825
: this((TController)null)
1926
{
2027
}
2128

29+
/// <summary>
30+
/// Initializes a new instance of the <see cref="MyController{TController}"/> class.
31+
/// </summary>
32+
/// <param name="controller">Instance of the ASP.NET Core MVC controller to test.</param>
2233
public MyController(TController controller)
2334
: this(() => controller)
2435
{
2536
}
2637

38+
/// <summary>
39+
/// Initializes a new instance of the <see cref="MyController{TController}"/> class.
40+
/// </summary>
41+
/// <param name="construction">Construction function returning the instantiated controller.</param>
2742
public MyController(Func<TController> construction)
2843
: base(new ControllerTestContext { ComponentConstructionDelegate = construction })
2944
{
3045
}
3146

47+
/// <summary>
48+
/// Starts a controller test.
49+
/// </summary>
50+
/// <returns>Test builder of <see cref="IControllerBuilder{TController}"/> type.</returns>
3251
public static IControllerBuilder<TController> Instance()
3352
{
3453
return Instance((TController)null);
3554
}
3655

56+
/// <summary>
57+
/// Starts a controller test.
58+
/// </summary>
59+
/// <param name="controller">Instance of the ASP.NET Core MVC controller to test.</param>
60+
/// <returns>Test builder of <see cref="IControllerBuilder{TController}"/> type.</returns>
3761
public static IControllerBuilder<TController> Instance(TController controller)
3862
{
3963
return Instance(() => controller);
4064
}
4165

66+
/// <summary>
67+
/// Starts a controller test.
68+
/// </summary>
69+
/// <param name="construction">Construction function returning the instantiated controller.</param>
70+
/// <returns>Test builder of <see cref="IControllerBuilder{TController}"/> type.</returns>
4271
public static IControllerBuilder<TController> Instance(Func<TController> construction)
4372
{
4473
return new MyController<TController>(construction);

src/MyTested.AspNetCore.Mvc.Controllers/ServiceCollectionControllersExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ public static IServiceCollection AddActionContextAccessor(this IServiceCollectio
2424
return serviceCollection.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
2525
}
2626

27+
/// <summary>
28+
/// Adds controller testing services.
29+
/// </summary>
30+
/// <param name="serviceCollection">Instance of <see cref="IServiceCollection"/> type.</param>
31+
/// <returns>The same <see cref="IServiceCollection"/>.</returns>
2732
public static IServiceCollection AddControllersTesting(this IServiceCollection serviceCollection)
2833
{
2934
CommonValidator.CheckForNullReference(serviceCollection, nameof(serviceCollection));

src/MyTested.AspNetCore.Mvc.Core/ServiceCollectionCoreExtensions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
using Microsoft.Extensions.DependencyInjection;
44
using Utilities.Validators;
55

6+
/// <summary>
7+
/// Contains extension methods for <see cref="IServiceCollection"/>.
8+
/// </summary>
69
public static class ServiceCollectionCoreExtensions
710
{
11+
/// <summary>
12+
/// Adds core MVC testing services.
13+
/// </summary>
14+
/// <param name="serviceCollection">Instance of <see cref="IServiceCollection"/> type.</param>
15+
/// <returns>The same <see cref="IServiceCollection"/>.</returns>
816
public static IServiceCollection AddMvcCoreTesting(this IServiceCollection serviceCollection)
917
{
1018
CommonValidator.CheckForNullReference(serviceCollection, nameof(serviceCollection));

src/MyTested.AspNetCore.Mvc.Http/ServiceCollectionHttpExtensions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
using Utilities.Validators;
99
using Internal.Formatters;
1010

11+
/// <summary>
12+
/// Contains HTTP extension methods for <see cref="IServiceCollection"/>.
13+
/// </summary>
1114
public static class ServiceCollectionHttpExtensions
1215
{
1316
/// <summary>
@@ -21,6 +24,11 @@ public static IServiceCollection AddHttpContextAccessor(this IServiceCollection
2124
return serviceCollection.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
2225
}
2326

27+
/// <summary>
28+
/// Adds an <see cref="IInputFormatter"/> which can process "text/plain" media type. Useful for testing with HTTP request body.
29+
/// </summary>
30+
/// <param name="serviceCollection">Instance of <see cref="IServiceCollection"/> type.</param>
31+
/// <returns>The same <see cref="IServiceCollection"/>.</returns>
2432
public static IServiceCollection AddStringInputFormatter(this IServiceCollection serviceCollection)
2533
{
2634
CommonValidator.CheckForNullReference(serviceCollection, nameof(IServiceCollection));

src/MyTested.AspNetCore.Mvc.Routing/MyRouting.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@
77
using Internal.Configuration;
88
using Internal.TestContexts;
99

10+
/// <summary>
11+
/// Provides methods to specify an ASP.NET Core MVC route test case.
12+
/// </summary>
1013
public class MyRouting : RouteTestBuilder
1114
{
1215
static MyRouting()
1316
{
1417
TestApplication.TryInitialize();
1518
}
1619

20+
/// <summary>
21+
/// Initializes a new instance of the <see cref="MyRouting"/> class.
22+
/// </summary>
1723
public MyRouting()
1824
: base(new RouteTestContext
1925
{
@@ -27,6 +33,10 @@ public MyRouting()
2733
}
2834
}
2935

36+
/// <summary>
37+
/// Starts a route test.
38+
/// </summary>
39+
/// <returns>Test builder of <see cref="IRouteTestBuilder"/> type.</returns>
3040
public static IRouteTestBuilder Configuration()
3141
{
3242
return new MyRouting();

0 commit comments

Comments
 (0)