Exemplo n.º 1
0
 public static void ThrowContractAssert <TDelegate, TAssertions>(
     this DelegateAssertions <TDelegate, TAssertions> assertions,
     string because = "",
     params object[] becauseArgs)
     where TDelegate : Delegate where TAssertions : DelegateAssertions <TDelegate, TAssertions>
 {
     assertions.Throw <ContractAssertException>(because, becauseArgs);
 }
Exemplo n.º 2
0
 public static void ThrowArgumentNullException <TDelegate, TAssertions>(this DelegateAssertions <TDelegate, TAssertions> delegateErrorAssertion, string argName)
     where TDelegate : Delegate
     where TAssertions : DelegateAssertions <TDelegate, TAssertions>
 {
     delegateErrorAssertion
     .Throw <ArgumentNullException>()
     .Which.ParamName.Should().Be(argName);
 }
Exemplo n.º 3
0
 public static ExceptionAssertions <GraphQLException> ThrowAuthorizationException <TDelegate>(
     this DelegateAssertions <TDelegate> assertions)
     where TDelegate : Delegate =>
 assertions.Throw <GraphQLException>()
 .WithMessage(
     @"*{""code"": 403, ""content"": {}, ""error_class"": ""ServiceException"", ""error_type"": ""ForbiddenAccess"", ""message"": ""This user does not have access to this resource""}");