Skip to content

Commit 3ab4903

Browse files
committed
Added more xml comments.
1 parent 28272ca commit 3ab4903

File tree

4 files changed

+61
-2
lines changed

4 files changed

+61
-2
lines changed

src/FluentAssertions.Ioc.Ninject/AssemblyAssertions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55

66
namespace FluentAssertions.Ioc.Ninject
77
{
8+
/// <summary>
9+
/// Contains a number of methods to assert that a <see cref="Assembly"/> is in the expected state.
10+
/// </summary>
811
public class AssemblyAssertions
912
{
1013
protected internal AssemblyAssertions(Assembly assembly)
1114
{
1215
Subject = assembly;
1316
}
1417

18+
/// <summary>
19+
/// Gets the assembly which is being asserted.
20+
/// </summary>
1521
public Assembly Subject { get; private set; }
1622

1723
/// <summary>

src/FluentAssertions.Ioc.Ninject/AssemblyExtensions.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,49 @@ namespace FluentAssertions.Ioc.Ninject
77
{
88
public static class AssemblyExtensions
99
{
10+
/// <summary>
11+
/// Gets all the public interfaces in an assembly.
12+
/// </summary>
13+
/// <param name="assembly">The assembly to search</param>
1014
public static IEnumerable<Type> GetPublicInterfaces(this Assembly assembly)
1115
{
1216
return GetAllInterfaces(assembly).Where(x => x.IsPublic);
1317
}
1418

19+
/// <summary>
20+
/// Gets all the interfaces in an assembly.
21+
/// </summary>
22+
/// <param name="assembly">The assembly to search</param>
1523
public static IEnumerable<Type> GetAllInterfaces(this Assembly assembly)
1624
{
1725
return assembly.GetTypes().Where(x => x.IsInterface);
1826
}
1927

28+
/// <summary>
29+
/// Filters for just the types in the specified namespace.
30+
/// </summary>
31+
/// <typeparam name="T">The namespace of this type.</typeparam>
32+
/// <param name="types">The types to filter.</param>
2033
public static IEnumerable<Type> InNamespaceOf<T>(this IEnumerable<Type> types)
2134
{
2235
return types.Where(x => x.Namespace == typeof(T).Namespace);
2336
}
2437

38+
/// <summary>
39+
/// Filters to exclude the specified type.
40+
/// </summary>
41+
/// <typeparam name="T">The type to exclude.</typeparam>
42+
/// <param name="types">The types to filter.</param>
2543
public static IEnumerable<Type> Excluding<T>(this IEnumerable<Type> types)
2644
{
2745
return types.Where(x => x.Name != typeof(T).Name);
2846
}
2947

48+
/// <summary>
49+
/// Filters to only include types where the type name ends with the specified string.
50+
/// </summary>
51+
/// <param name="types">The types to filter.</param>
52+
/// <param name="endingWith">The ending with string.</param>
3053
public static IEnumerable<Type> EndingWith(this IEnumerable<Type> types, string endingWith)
3154
{
3255
return types.Where(x => x.Name.EndsWith(endingWith));

src/FluentAssertions.Ioc.Ninject/FindAssembly.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ namespace FluentAssertions.Ioc.Ninject
44
{
55
public static class FindAssembly
66
{
7+
/// <summary>
8+
/// Finds the assembly containing the specified type.
9+
/// </summary>
10+
/// <typeparam name="T">The type to find.</typeparam>
11+
/// <returns>The assembly.</returns>
712
public static Assembly Containing<T>()
813
{
914
return typeof(T).Assembly;

src/FluentAssertions.Ioc.Ninject/KernelAssertions.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,50 @@
77

88
namespace FluentAssertions.Ioc.Ninject
99
{
10+
/// <summary>
11+
/// Contains a number of methods to assert that a <see cref="IKernel"/> is in the expected state.
12+
/// </summary>
1013
public class KernelAssertions
1114
{
1215
protected internal KernelAssertions(IKernel kernel)
1316
{
1417
Subject = kernel;
1518
}
1619

20+
/// <summary>
21+
/// Gets the kernel which is being asserted.
22+
/// </summary>
1723
public IKernel Subject { get; private set; }
24+
25+
/// <summary>
26+
/// Gets the interfaces which trying to be resolved.
27+
/// </summary>
1828
private IEnumerable<Type> Interfaces { get; set; }
1929

30+
/// <summary>
31+
/// Specifies the interfaces to try resolving from the kernel.
32+
/// </summary>
33+
/// <param name="interfaces">The interfaces to resolve.</param>
2034
public KernelAssertions ResolveInterfaces(IEnumerable<Type> interfaces)
2135
{
2236
Interfaces = interfaces;
2337
return this;
2438
}
2539

26-
public KernelAssertions ResolveInterface<TInferface>()
40+
/// <summary>
41+
/// Specifies the interface to try resolving from the kernel.
42+
/// </summary>
43+
/// <typeparam name="TInterface">The interface to resolve.</typeparam>
44+
/// <returns></returns>
45+
public KernelAssertions ResolveInterface<TInterface>()
2746
{
28-
Interfaces = new List<Type>() { typeof(TInferface) };
47+
Interfaces = new List<Type>() { typeof(TInterface) };
2948
return this;
3049
}
3150

51+
/// <summary>
52+
/// Asserts that the selected interface(s) can be resolved with a single instance.
53+
/// </summary>
3254
public void WithSingleInstance()
3355
{
3456
var failed = new List<ActivationError>();
@@ -55,6 +77,9 @@ public void WithSingleInstance()
5577
.FailWith(BuildFailureMessage(failed));
5678
}
5779

80+
/// <summary>
81+
/// Asserts that the selected interface(s) can be resolved with at least one instance.
82+
/// </summary>
5883
public void WithAtLeastOneInstance()
5984
{
6085
var failed = new List<ActivationError>();

0 commit comments

Comments
 (0)