Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

public abstract partial class EnumerableQuantifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

public abstract partial class EnumerableQuantifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

public abstract partial class EnumerableQuantifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

public abstract partial class EnumerableQuantifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

public abstract partial class EnumerableQuantifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

public abstract partial class EnumerableQuantifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

public abstract partial class EnumerableQuantifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

public abstract partial class EnumerableQuantifier
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using aweXpect.Core;
using aweXpect.Core.Constraints;

namespace aweXpect;
namespace aweXpect.Options;

/// <summary>
/// Quantifier for evaluating collections.
Expand Down
32 changes: 0 additions & 32 deletions Source/aweXpect/Results/CollectionBeContainedInResult.cs

This file was deleted.

31 changes: 0 additions & 31 deletions Source/aweXpect/Results/CollectionContainResult.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using aweXpect.Results;
using aweXpect.Options;

namespace aweXpect;
namespace aweXpect.Results;

/// <summary>
/// The result for counting items in a collection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ namespace aweXpect.Results;
/// <remarks>
/// <seealso cref="AndOrResult{TCollection, TThat}" />
/// </remarks>
public class ContainsValueResult<TCollection, TThat, TKey, TValue>
public class ContainsKeyResult<TCollection, TThat, TKey, TValue>
: AndOrResult<TCollection, TThat>
{
private readonly ExpectationBuilder _expectationBuilder;
private readonly TKey _key;
private readonly Func<TCollection, TValue> _memberAccessor;

internal ContainsValueResult(
internal ContainsKeyResult(
ExpectationBuilder expectationBuilder,
TThat returnValue,
TKey key,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using aweXpect.Core;
using aweXpect.Options;

namespace aweXpect.Results;

Expand All @@ -10,14 +11,14 @@ namespace aweXpect.Results;
/// <remarks>
/// <seealso cref="AndOrResult{TCollection, TThat}" />
/// </remarks>
public class ContainsValuesResult<TCollection, TThat, TKey, TValue>
public class ContainsKeysResult<TCollection, TThat, TKey, TValue>
: AndOrResult<TCollection, TThat>
{
private readonly ExpectationBuilder _expectationBuilder;
private readonly TKey[] _keys;
private readonly Func<TCollection, IEnumerable<TValue>> _memberAccessor;

internal ContainsValuesResult(
internal ContainsKeysResult(
ExpectationBuilder expectationBuilder,
TThat returnValue,
TKey[] keys,
Expand Down
33 changes: 0 additions & 33 deletions Source/aweXpect/Results/ObjectCollectionBeContainedInResult.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,31 @@
namespace aweXpect.Results;

/// <summary>
/// The result for verifying that a collection contains another collection.
/// The result for verifying that a collection contains or is contained in another collection.
/// </summary>
/// <remarks>
/// <seealso cref="ObjectCollectionMatchResult{TType,TThat,TItem}" />
/// </remarks>
public class ObjectCollectionContainResult<TType, TThat, TItem>(
public class ObjectProperCollectionMatchResult<TType, TThat, TItem>(

Check warning on line 12 in Source/aweXpect/Results/ObjectProperCollectionMatchResult.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This class has 6 parents which is greater than 5 authorized.

See more on https://sonarcloud.io/project/issues?id=Testably_aweXpect&issues=AaCkU2a6Y0Ti_9-uRGP9&open=AaCkU2a6Y0Ti_9-uRGP9&pullRequest=1121
ExpectationBuilder expectationBuilder,
TThat returnValue,
ObjectEqualityOptions<TItem> options,
CollectionMatchOptions collectionMatchOptions)
CollectionMatchOptions collectionMatchOptions,
CollectionMatchOptions.EquivalenceRelations properEquivalenceRelation)
: ObjectCollectionMatchResult<TType, TThat, TItem>(expectationBuilder, returnValue, options, collectionMatchOptions)
{
private readonly CollectionMatchOptions _collectionMatchOptions = collectionMatchOptions;

/// <summary>
/// Verifies that the subject contain all expected items and at least one additional item.
/// Verifies that the two collections differ by at least one additional item.
/// </summary>
/// <remarks>
/// This means, that the expected collection is a proper subset.
/// This means, that the expected collection is a proper subset of the subject for <c>Contains</c> and a proper
/// superset for <c>IsContainedIn</c>.
/// </remarks>
public ObjectCollectionMatchResult<TType, TThat, TItem> Properly()
{
_collectionMatchOptions.SetEquivalenceRelation(CollectionMatchOptions.EquivalenceRelations.ContainsProperly);
_collectionMatchOptions.SetEquivalenceRelation(properEquivalenceRelation);
return this;
}
}
33 changes: 33 additions & 0 deletions Source/aweXpect/Results/ProperCollectionMatchResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using aweXpect.Core;
using aweXpect.Options;

namespace aweXpect.Results;

/// <summary>
/// The result for verifying that a collection contains or is contained in another collection.
/// </summary>
/// <remarks>
/// <seealso cref="CollectionMatchResult{TType,TThat,TItem}" />
/// </remarks>
public class ProperCollectionMatchResult<TType, TThat, TItem>(

Check warning on line 12 in Source/aweXpect/Results/ProperCollectionMatchResult.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This class has 6 parents which is greater than 5 authorized.

See more on https://sonarcloud.io/project/issues?id=Testably_aweXpect&issues=AaCkU2axY0Ti_9-uRGP8&open=AaCkU2axY0Ti_9-uRGP8&pullRequest=1121
ExpectationBuilder expectationBuilder,
TThat returnValue,
CollectionMatchOptions collectionMatchOptions,
CollectionMatchOptions.EquivalenceRelations properEquivalenceRelation)
: CollectionMatchResult<TType, TThat, TItem>(expectationBuilder, returnValue, collectionMatchOptions)
{
private readonly CollectionMatchOptions _collectionMatchOptions = collectionMatchOptions;

/// <summary>
/// Verifies that the two collections differ by at least one additional item.
/// </summary>
/// <remarks>
/// This means, that the expected collection is a proper subset of the subject for <c>Contains</c> and a proper
/// superset for <c>IsContainedIn</c>.
/// </remarks>
public CollectionMatchResult<TType, TThat, TItem> Properly()
{
_collectionMatchOptions.SetEquivalenceRelation(properEquivalenceRelation);
return this;
}
}
33 changes: 0 additions & 33 deletions Source/aweXpect/Results/StringCollectionBeContainedInResult.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,31 @@
namespace aweXpect.Results;

/// <summary>
/// The result for verifying that a string collection contains another collection.
/// The result for verifying that a string collection contains or is contained in another collection.
/// </summary>
/// <remarks>
/// <seealso cref="StringCollectionMatchResult{TType,TThat}" />
/// </remarks>
public class StringCollectionContainResult<TType, TThat>(
public class StringProperCollectionMatchResult<TType, TThat>(

Check warning on line 12 in Source/aweXpect/Results/StringProperCollectionMatchResult.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This class has 8 parents which is greater than 5 authorized.

See more on https://sonarcloud.io/project/issues?id=Testably_aweXpect&issues=AaCkU2XcY0Ti_9-uRGP7&open=AaCkU2XcY0Ti_9-uRGP7&pullRequest=1121
ExpectationBuilder expectationBuilder,
TThat returnValue,
StringEqualityOptions options,
CollectionMatchOptions collectionMatchOptions)
CollectionMatchOptions collectionMatchOptions,
CollectionMatchOptions.EquivalenceRelations properEquivalenceRelation)
: StringCollectionMatchResult<TType, TThat>(expectationBuilder, returnValue, options, collectionMatchOptions)
{
private readonly CollectionMatchOptions _collectionMatchOptions = collectionMatchOptions;

/// <summary>
/// Verifies that the subject contain all expected items and at least one additional item.
/// Verifies that the two collections differ by at least one additional item.
/// </summary>
/// <remarks>
/// This means, that the expected collection is a proper subset.
/// This means, that the expected collection is a proper subset of the subject for <c>Contains</c> and a proper
/// superset for <c>IsContainedIn</c>.
/// </remarks>
public StringCollectionMatchResult<TType, TThat> Properly()
{
_collectionMatchOptions.SetEquivalenceRelation(CollectionMatchOptions.EquivalenceRelations.ContainsProperly);
_collectionMatchOptions.SetEquivalenceRelation(properEquivalenceRelation);
return this;
}
}
1 change: 1 addition & 0 deletions Source/aweXpect/That/Collections/CollectionHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using aweXpect.Core;
using aweXpect.Customization;
using aweXpect.Helpers;
using aweXpect.Options;

namespace aweXpect;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using aweXpect.Core;
using aweXpect.Helpers;
using aweXpect.Options;

namespace aweXpect;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using aweXpect.Core;
using aweXpect.Helpers;
using aweXpect.Options;

namespace aweXpect;

Expand Down
Loading
Loading