Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Leoxia.Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
leoxia
Leoxia.Core
Commits
88200182
Commit
88200182
authored
Jun 20, 2017
by
Fabien Bondi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test
parent
bf83aada
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
89 additions
and
62 deletions
+89
-62
src/Leoxia.Log/StringLogger.cs
src/Leoxia.Log/StringLogger.cs
+6
-8
src/Leoxia.Network/IPAddressExtensions.cs
src/Leoxia.Network/IPAddressExtensions.cs
+1
-0
src/Leoxia.Testing.Assertions/Abstractions/IExceptionFactory.cs
...oxia.Testing.Assertions/Abstractions/IExceptionFactory.cs
+2
-2
src/Leoxia.Testing.Assertions/Abstractions/ITypeCheckable.cs
src/Leoxia.Testing.Assertions/Abstractions/ITypeCheckable.cs
+1
-1
src/Leoxia.Testing.Assertions/Check.cs
src/Leoxia.Testing.Assertions/Check.cs
+11
-11
src/Leoxia.Testing.Assertions/CheckType.cs
src/Leoxia.Testing.Assertions/CheckType.cs
+40
-21
src/Leoxia.Testing.Assertions/DateTimeCheckable.cs
src/Leoxia.Testing.Assertions/DateTimeCheckable.cs
+2
-2
src/Leoxia.Testing.Assertions/EquatableCheckable.cs
src/Leoxia.Testing.Assertions/EquatableCheckable.cs
+4
-4
src/Leoxia.Testing.Assertions/Failures/BaseCheckFailure.cs
src/Leoxia.Testing.Assertions/Failures/BaseCheckFailure.cs
+10
-7
src/Leoxia.Testing.Assertions/Failures/ClassCheckFailure.cs
src/Leoxia.Testing.Assertions/Failures/ClassCheckFailure.cs
+3
-3
src/Leoxia.Testing.Assertions/Failures/EqualCheckFailure.cs
src/Leoxia.Testing.Assertions/Failures/EqualCheckFailure.cs
+3
-3
src/Leoxia.Testing.Assertions/ICheckFailure.cs
src/Leoxia.Testing.Assertions/ICheckFailure.cs
+1
-0
src/Leoxia.Testing.Reflection/ObjectComparer.cs
src/Leoxia.Testing.Reflection/ObjectComparer.cs
+5
-0
No files found.
src/Leoxia.Log/StringLogger.cs
View file @
88200182
...
...
@@ -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>
...
...
src/Leoxia.Network/IPAddressExtensions.cs
View file @
88200182
...
...
@@ -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
)
...
...
src/Leoxia.Testing.Assertions/Abstractions/IExceptionFactory.cs
View file @
88200182
...
...
@@ -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>
...
...
src/Leoxia.Testing.Assertions/Abstractions/ITypeCheckable.cs
View file @
88200182
...
...
@@ -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
>
...
...
src/Leoxia.Testing.Assertions/Check.cs
View file @
88200182
...
...
@@ -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>
...
...
src/Leoxia.Testing.Assertions/CheckType.cs
View file @
88200182
...
...
@@ -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
}
...
...
src/Leoxia.Testing.Assertions/DateTimeCheckable.cs
View file @
88200182
...
...
@@ -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>
...
...
src/Leoxia.Testing.Assertions/EquatableCheckable.cs
View file @
88200182
...
...
@@ -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>
...
...
src/Leoxia.Testing.Assertions/Failures/BaseCheckFailure.cs
View file @
88200182
...
...
@@ -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
();
...
...
src/Leoxia.Testing.Assertions/Failures/ClassCheckFailure.cs
View file @
88200182
...
...
@@ -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
()
...
...
src/Leoxia.Testing.Assertions/Failures/EqualCheckFailure.cs
View file @
88200182
...
...
@@ -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>
...
...
src/Leoxia.Testing.Assertions/ICheckFailure.cs
View file @
88200182
...
...
@@ -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
>
{
}
...
...
src/Leoxia.Testing.Reflection/ObjectComparer.cs
View file @
88200182
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment