public void ThrowsArgumentNullException_WhenQueryArgIsNull() { ArgumentNullException exception = null; try { GenerateRandomSecretHandler.Handle(null); } catch (ArgumentNullException ex) { exception = ex; } exception.ShouldNotBeNull(); // ReSharper disable PossibleNullReferenceException exception.ParamName.ShouldEqual("query"); // ReSharper restore PossibleNullReferenceException }
public void ThrowsArgumentNullException_WhenCommandArgIsNull() { ArgumentNullException exception = null; var handler = new UpdateMyNameHandler(null); try { handler.Handle(null); } catch (ArgumentNullException ex) { exception = ex; } exception.ShouldNotBeNull(); // ReSharper disable PossibleNullReferenceException exception.ParamName.ShouldEqual("command"); // ReSharper restore PossibleNullReferenceException }
public void ThrowsArgumentNullException_WhenQueryArgIsNull() { var handler = new GetPersonByGuidHandler(null); ArgumentNullException exception = null; try { handler.Handle(null); } catch (ArgumentNullException ex) { exception = ex; } exception.ShouldNotBeNull(); // ReSharper disable PossibleNullReferenceException exception.ParamName.ShouldEqual("query"); // ReSharper restore PossibleNullReferenceException }
public void ThrowsArgumentNullException_WhenParamNameArgIsNull() { ArgumentNullException exception = null; try { var obj = new ValidateRedeemTicketAttribute(null, EmailConfirmationIntent.ResetPassword); obj.ShouldBeNull(); } catch (ArgumentNullException ex) { exception = ex; } exception.ShouldNotBeNull(); // ReSharper disable PossibleNullReferenceException exception.ParamName.ShouldEqual("paramName"); // ReSharper restore PossibleNullReferenceException }
public void ThrowsArgumentNullException_WhenArgIsNull() { ArgumentNullException exception = null; try { var obj = new ValidateConfirmEmailAttribute(null); obj.ShouldBeNull(); } catch (ArgumentNullException ex) { exception = ex; } exception.ShouldNotBeNull(); // ReSharper disable PossibleNullReferenceException exception.ParamName.ShouldEqual("paramName"); // ReSharper restore PossibleNullReferenceException }
public void Should_throw_an_exception() { _thrown.ShouldNotBeNull(); _thrown.Message.ShouldContain("connectionStringName"); }