コード例 #1
0
 /// <inheritdoc cref="ThenAssertErrorDetail{TInput}(WhenBlock{TInput, InvalidDeriveOperationException}, string, string)"/>
 public static ThenBlock <FactFactoryException, FactFactoryException> ThenAssertErrorDetail <TInput>(this WhenBlock <TInput, FactFactoryException> whenBlock, string errorCode, string errorMessage)
 {
     return(whenBlock
            .ThenIsNotNull()
            .And($"Check error with code {errorCode}", error =>
                 error.AssertErrorDetail(errorCode, errorMessage)));
 }
コード例 #2
0
 public static ThenBlock <TFactWork, TFactWork> ThenNotContainVersionType <TInput, TFactWork>(this WhenBlock <TInput, TFactWork> whenBlock)
     where TFactWork : IFactWork
 {
     return(whenBlock
            .ThenIsNotNull()
            .And("Get type of version.", work => Assert.IsNull(work.InputFactTypes?.FirstVersionFactType())));
 }
コード例 #3
0
 /// <summary>
 /// Then block for check <see cref="FactBase{TFactValue}.Value"/>.
 /// </summary>
 /// <typeparam name="TInput">Input type</typeparam>
 /// <typeparam name="TFact">Fact type</typeparam>
 /// <typeparam name="TFactValue">Fact value type.</typeparam>
 /// <param name="whenBlock">Previous when block</param>
 /// <param name="expectedValue">Expected value</param>
 /// <returns>Then block</returns>
 public static ThenBlock <TFact, TFact> ThenFactValueEquals <TInput, TFact, TFactValue>(this WhenBlock <TInput, TFact> whenBlock, TFactValue expectedValue)
     where TFact : FactBase <TFactValue>
 {
     return(whenBlock
            .ThenIsNotNull()
            .AndAreEqual(fact => fact.Value, expectedValue,
                         errorMessage: $"A different meaning of the {typeof(TFact).Name} fact was expected", blockName: $"Check assert {typeof(TFact).Name} fact."));
 }