Commit 88200182 authored by Fabien Bondi's avatar Fabien Bondi

Fix test

parent bf83aada
......@@ -35,7 +35,6 @@
#region Usings
using System.Collections.Generic;
using System.IO;
using System.Text;
#endregion
......@@ -43,7 +42,6 @@ using System.Text;
namespace Leoxia.Log
{
/// <summary>
///
/// </summary>
public class StringLogger
{
......@@ -56,10 +54,10 @@ namespace Leoxia.Log
}
/// <summary>
/// Gets the log.
/// Gets the log.
/// </summary>
/// <value>
/// The log.
/// The log.
/// </value>
public static List<string> Log { get; private set; }
......@@ -123,7 +121,7 @@ namespace Leoxia.Log
}
/// <summary>
/// Logs the get property after.
/// Logs the get property after.
/// </summary>
/// <typeparam name="K"></typeparam>
/// <param name="instance">The instance.</param>
......@@ -137,7 +135,7 @@ namespace Leoxia.Log
}
/// <summary>
/// Logs the get property before.
/// Logs the get property before.
/// </summary>
/// <param name="instance">The instance.</param>
/// <param name="propertyName">Name of the property.</param>
......@@ -147,7 +145,7 @@ namespace Leoxia.Log
}
/// <summary>
/// Logs the set property before.
/// Logs the set property before.
/// </summary>
/// <typeparam name="K"></typeparam>
/// <param name="instance">The instance.</param>
......@@ -162,7 +160,7 @@ namespace Leoxia.Log
}
/// <summary>
/// Logs the set property after.
/// Logs the set property after.
/// </summary>
/// <typeparam name="K"></typeparam>
/// <param name="instance">The instance.</param>
......
......@@ -51,6 +51,7 @@ namespace Leoxia.Network
/// </summary>
/// <param name="address">The address.</param>
/// <returns>Type of network</returns>
// ReSharper disable once ExcessiveIndentation
public static IPNetworkType GetNetworkType(this IPAddress address)
{
switch (address.AddressFamily)
......
......@@ -41,12 +41,12 @@ using System;
namespace Leoxia.Testing.Assertions.Abstractions
{
/// <summary>
/// Interface for factory of <see cref="Exception"/>
/// Interface for factory of <see cref="Exception" />
/// </summary>
public interface IExceptionFactory
{
/// <summary>
/// Builds the specified <see cref="Exception"/>.
/// Builds the specified <see cref="Exception" />.
/// </summary>
/// <typeparam name="T">type of tested object</typeparam>
/// <param name="failure">The failure.</param>
......
......@@ -41,7 +41,7 @@ using System;
namespace Leoxia.Testing.Assertions.Abstractions
{
/// <summary>
/// Interface for checks on <see cref="Type"/>
/// Interface for checks on <see cref="Type" />
/// </summary>
/// <seealso cref="Leoxia.Testing.Assertions.Abstractions.IClassCheckable{Type}" />
public interface ITypeCheckable : IClassCheckable<Type>
......
......@@ -44,14 +44,14 @@ using Leoxia.Testing.Assertions.Abstractions;
namespace Leoxia.Testing.Assertions
{
/// <summary>
/// Entry class for fluent assertions.
/// Entry class for fluent assertions.
/// </summary>
public static class Check
{
private static readonly IExceptionFactory _factory;
/// <summary>
/// Initializes the <see cref="Check"/> class.
/// Initializes the <see cref="Check" /> class.
/// </summary>
static Check()
{
......@@ -59,7 +59,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <param name="value">if set to <c>true</c> [value].</param>
/// <returns></returns>
......@@ -69,7 +69,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
......@@ -79,7 +79,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
......@@ -89,7 +89,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value">The value.</param>
......@@ -100,7 +100,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
......@@ -110,7 +110,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
......@@ -125,7 +125,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value">The value.</param>
......@@ -137,7 +137,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
......@@ -147,7 +147,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Check on the specified value.
/// Check on the specified value.
/// </summary>
/// <param name="value">The value.</param>
/// <returns></returns>
......
......@@ -35,88 +35,107 @@
namespace Leoxia.Testing.Assertions
{
/// <summary>
/// The different check types.
/// The different check types.
/// </summary>
public enum CheckType
{
/// <summary>
/// The true
/// The true
/// </summary>
True,
/// <summary>
/// The false
/// The false
/// </summary>
False,
/// <summary>
/// The null
/// The null
/// </summary>
Null,
/// <summary>
/// The not null
/// The not null
/// </summary>
NotNull,
/// <summary>
/// The equal
/// The equal
/// </summary>
Equal,
/// <summary>
/// The not equal
/// The not equal
/// </summary>
NotEqual,
/// <summary>
/// The op equal
/// The op equal
/// </summary>
OpEqual,
/// <summary>
/// The op not equal
/// The op not equal
/// </summary>
OpNotEqual,
/// <summary>
/// The count not equal
/// The count not equal
/// </summary>
CountNotEqual,
/// <summary>
/// The list item not equal
/// The list item not equal
/// </summary>
ListItemNotEqual,
/// <summary>
/// The list item all equal
/// The list item all equal
/// </summary>
ListItemAllEqual,
/// <summary>
/// The string null or empty
/// The string null or empty
/// </summary>
StringNullOrEmpty,
/// <summary>
/// The string not null or empty
/// The string not null or empty
/// </summary>
StringNotNullOrEmpty,
/// <summary>
/// The properties not equal
/// The properties not equal
/// </summary>
PropertiesNotEqual,
/// <summary>
/// The properties not initialized
/// The properties not initialized
/// </summary>
PropertiesNotInitialized,
/// <summary>
/// The properties equal
/// The properties equal
/// </summary>
PropertiesEqual,
/// <summary>
/// The properties initialized
/// The properties initialized
/// </summary>
PropertiesInitialized,
/// <summary>
/// The count equal
/// The count equal
/// </summary>
CountEqual,
/// <summary>
/// The list item equal
/// The list item equal
/// </summary>
ListItemEqual,
/// <summary>
/// The list item is not contained
/// The list item is not contained
/// </summary>
ListItemIsNotContained
}
......
......@@ -42,14 +42,14 @@ using Leoxia.Testing.Assertions.Abstractions;
namespace Leoxia.Testing.Assertions
{
/// <summary>
/// Checks for <see cref="DateTime"/>
/// Checks for <see cref="DateTime" />
/// </summary>
/// <seealso cref="Leoxia.Testing.Assertions.BaseCheckable{DateTime}" />
/// <seealso cref="Leoxia.Testing.Assertions.Abstractions.IDateTimeCheckable" />
public class DateTimeCheckable : BaseCheckable<DateTime>, IDateTimeCheckable
{
/// <summary>
/// Initializes a new instance of the <see cref="DateTimeCheckable"/> class.
/// Initializes a new instance of the <see cref="DateTimeCheckable" /> class.
/// </summary>
/// <param name="factory">The factory.</param>
/// <param name="value">The value.</param>
......
......@@ -42,7 +42,7 @@ using Leoxia.Testing.Assertions.Abstractions;
namespace Leoxia.Testing.Assertions
{
/// <summary>
/// Checks for <see cref="IEquatable{T}"/>
/// Checks for <see cref="IEquatable{T}" />
/// </summary>
/// <typeparam name="T"></typeparam>
/// <seealso cref="Leoxia.Testing.Assertions.BaseClassCheckable{IEquatable}" />
......@@ -51,7 +51,7 @@ namespace Leoxia.Testing.Assertions
where T : IEquatable<T>
{
/// <summary>
/// Initializes a new instance of the <see cref="EquatableCheckable{T}"/> class.
/// Initializes a new instance of the <see cref="EquatableCheckable{T}" /> class.
/// </summary>
/// <param name="factory"></param>
/// <param name="value"></param>
......@@ -60,7 +60,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Checks the Inner is equal to
/// Checks the Inner is equal to
/// </summary>
/// <param name="expected">The expected.</param>
/// <param name="message">The message.</param>
......@@ -71,7 +71,7 @@ namespace Leoxia.Testing.Assertions
}
/// <summary>
/// Checks the Inner is not equal to
/// Checks the Inner is not equal to
/// </summary>
/// <param name="expected">The expected.</param>
/// <param name="message">The message.</param>
......
......@@ -42,31 +42,34 @@ using System.Collections;
namespace Leoxia.Testing.Assertions.Failures
{
/// <summary>
/// Base class for displaying the check failure message.
/// Base class for displaying the check failure message.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <seealso cref="Leoxia.Testing.Assertions.ICheckFailure{IList}" />
public abstract class BaseCheckFailure<T> : ICheckFailure<IList>
{
/// <summary>
/// The expected
/// The expected
/// </summary>
protected readonly T _expected;
/// <summary>
/// The message
/// The message
/// </summary>
protected readonly string _message;
/// <summary>
/// The tested
/// The tested
/// </summary>
protected readonly T _tested;
/// <summary>
/// The type
/// The type
/// </summary>
protected readonly CheckType _type;
/// <summary>
/// Initializes a new instance of the <see cref="BaseCheckFailure{T}"/> class.
/// Initializes a new instance of the <see cref="BaseCheckFailure{T}" /> class.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="tested">The tested.</param>
......@@ -93,7 +96,7 @@ namespace Leoxia.Testing.Assertions.Failures
}
/// <summary>
/// Displays the message.
/// Displays the message.
/// </summary>
/// <returns></returns>
protected abstract string DisplayMessage();
......
......@@ -35,14 +35,14 @@
namespace Leoxia.Testing.Assertions.Failures
{
/// <summary>
/// Checks for classes.
/// Checks for classes.
/// </summary>
/// <typeparam name="T">type of tested element</typeparam>
/// <seealso cref="Leoxia.Testing.Assertions.Failures.BaseCheckFailure{T}" />
public class ClassCheckFailure<T> : BaseCheckFailure<T>
{
/// <summary>
/// Initializes a new instance of the <see cref="ClassCheckFailure{T}"/> class.
/// Initializes a new instance of the <see cref="ClassCheckFailure{T}" /> class.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="tested">The tested.</param>
......@@ -54,7 +54,7 @@ namespace Leoxia.Testing.Assertions.Failures
}
/// <summary>
/// Displays the message.
/// Displays the message.
/// </summary>
/// <returns></returns>
protected override string DisplayMessage()
......
......@@ -41,14 +41,14 @@ using System;
namespace Leoxia.Testing.Assertions.Failures
{
/// <summary>
/// Display message on check failure for equality.
/// Display message on check failure for equality.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <seealso cref="Leoxia.Testing.Assertions.Failures.BaseCheckFailure{T}" />
public class EqualCheckFailure<T> : BaseCheckFailure<T>
{
/// <summary>
/// Initializes a new instance of the <see cref="EqualCheckFailure{T}"/> class.
/// Initializes a new instance of the <see cref="EqualCheckFailure{T}" /> class.
/// </summary>
/// <param name="type">The type.</param>
/// <param name="tested">The tested.</param>
......@@ -60,7 +60,7 @@ namespace Leoxia.Testing.Assertions.Failures
}
/// <summary>
/// Displays the message.
/// Displays the message.
/// </summary>
/// <returns></returns>
/// <exception cref="System.ArgumentOutOfRangeException"></exception>
......
......@@ -38,6 +38,7 @@ namespace Leoxia.Testing.Assertions
/// Interface for Check Failure of T
/// </summary>
/// <typeparam name="T">type of tested value</typeparam>
// ReSharper disable once UnusedTypeParameter
public interface ICheckFailure<T>
{
}
......
......@@ -39,6 +39,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Leoxia.Collections;
#endregion
......@@ -144,6 +145,10 @@ namespace Leoxia.Testing.Reflection
IEnumerable<string> excludedList)
{
var names = new List<string>(properties.Count);
if (excludedList == null)
{
excludedList = EmptyArray<string>.Instance;
}
var excludedProperties = excludedList as IList<string> ?? excludedList.ToArray();
foreach (var propertyInfo in properties)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment