Beispiel #1
0
 /// <summary>
 /// Adds an assertion to the specified fixture that the result returned will be a collection of the specified length.
 /// </summary>
 /// <param name="fixture">The fixture.</param>
 /// <param name="count">The count.</param>
 /// <returns></returns>
 public static ITestFixture ShouldReturnCollectionWithCount(this ITestFixture fixture, int count) =>
 fixture.ShouldReturn <IEnumerable>(x => x.Should().HaveCount(count));
Beispiel #2
0
 /// <summary>
 /// Adds an assertion to the specified fixture that the result returned should be false.
 /// </summary>
 /// <param name="fixture">The fixture.</param>
 /// <returns></returns>
 public static ITestFixture ShouldReturnFalse(this ITestFixture fixture) =>
 fixture.ShouldReturn <bool>(x => x.Should().BeFalse());
Beispiel #3
0
 /// <summary>
 /// Adds an assertion to the specified fixture that the result returned will be an empty collection.
 /// </summary>
 /// <param name="fixture">The fixture.</param>
 /// <returns></returns>
 public static ITestFixture ShouldReturnEmptyCollection(this ITestFixture fixture) =>
 fixture.ShouldReturn <IEnumerable>(x => x.Should().BeEmpty());
Beispiel #4
0
 /// <summary>
 /// Adds an assertion to the specified fixture that the result returned should be null.
 /// </summary>
 /// <param name="fixture">The fixture.</param>
 /// <returns></returns>
 public static ITestFixture ShouldReturnNull(this ITestFixture fixture) =>
 fixture.ShouldReturn(x => x.Should().BeNull());
Beispiel #5
0
 /// <summary>
 /// Adds an assertion to the specified fixture that the result returned should be an object equivalent to the specified result.
 /// </summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="fixture">The fixture.</param>
 /// <param name="expected">The expected.</param>
 /// <param name="config">The configuration.</param>
 /// <returns></returns>
 public static ITestFixture ShouldReturnEquivalent <TResult>(this ITestFixture fixture,
                                                             TResult expected,
                                                             Func <EquivalencyAssertionOptions <TResult>, EquivalencyAssertionOptions <TResult> > config) =>
 fixture.ShouldReturn(r => r.Should().BeEquivalentTo(expected, config));
Beispiel #6
0
 /// <summary>
 /// Adds an assertion to the specified fixture that the result returned should be an object equivalent to the specified result.
 /// </summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="fixture">The fixture.</param>
 /// <param name="result">The result.</param>
 /// <returns></returns>
 public static ITestFixture ShouldReturnEquivalent <TResult>(this ITestFixture fixture, TResult result) =>
 fixture.ShouldReturn(x => x.Should().BeEquivalentTo(result));
Beispiel #7
0
 /// <summary>
 /// Adds an assertion to the specified fixture that the result returned should be an object that equals the specified result.
 /// </summary>
 /// <typeparam name="TResult">The type of the result.</typeparam>
 /// <param name="fixture">The fixture.</param>
 /// <param name="result">The result.</param>
 /// <returns></returns>
 public static ITestFixture ShouldReturn <TResult>(this ITestFixture fixture, TResult result) =>
 fixture.ShouldReturn <TResult>(x => x.Should().Be(result));
Beispiel #8
0
 /// <summary>
 /// Adds an assertion to the specified fixture that the result returned will be a collection with the same length as the specified collection.
 /// </summary>
 /// <param name="fixture">The fixture.</param>
 /// <param name="collection">The collection.</param>
 /// <returns></returns>
 public static ITestFixture ShouldReturnCollectionWithSameCount(this ITestFixture fixture, IEnumerable collection) =>
 fixture.ShouldReturn <IEnumerable>(x => x.Should().HaveSameCount(collection));