コード例 #1
0
 public void ValidStreet_For_MissingPostCode_Throw_MissingPostCode()
 {
     FluentActions.Invoking(() => new Address("Opole", "Prószkowska", null, 76))
     .Should()
     .Throw <ArgumentException>();
 }
コード例 #2
0
 public void ShouldThrowUnsupportedColourExceptionGivenNotSupportedColourCode()
 {
     FluentActions.Invoking(() => Colour.From("##FF33CC"))
     .Should().Throw <UnsupportedColourException>();
 }
コード例 #3
0
        public void NotAllowNullInCreateTasks()
        {
            var sut = new TaskService(new FakeTaskApi(_testData));

            FluentActions.Invoking(() => sut.CreateTasks(null)).Should().Throw <ArgumentNullException>();
        }
コード例 #4
0
 public void SchemaGeneratorInstatiation()
 {
     FluentActions.Invoking(() => new SchemaWizard())
     .Should()
     .NotThrow();
 }
コード例 #5
0
 public void Should_throw_exception_if_negative_value(int min, int max)
 {
     FluentActions.Invoking(() => new DeliveryTime(min, max)).Should().Throw <NegativeDeliveryTimeException>();
 }
コード例 #6
0
 public void AppleAuthClient_NotValidArgument_ThrowArgumentException(AppleAuthSetting authSetting, IAppleTokenGenerator privateKeySetting, HttpClient httpClient)
 {
     FluentActions.Invoking(() => new AppleAuthClient(authSetting, privateKeySetting, httpClient)).Should().Throw <ArgumentException>();
 }
コード例 #7
0
 public void Throw_Error_AccountToTransfer_Is_Null()
 {
     FluentActions.Invoking(() => _sut.TransferMoney(Option.None <AccountToTransfer>())).Should()
     .Throw <ArgumentException>();
 }
コード例 #8
0
ファイル: WhenDispatching.cs プロジェクト: brenpike/Chatter
 public async Task MustThrowWhenMessageHandlerIsInvokedAndRaisesException()
 {
     _serviceProvider.Setup(p => p.GetService(typeof(ICommandBehaviorPipeline <IMessage>))).Returns(null);
     _handler.Setup(p => p.Handle(It.IsAny <IMessage>(), It.IsAny <IMessageHandlerContext>())).Throws <Exception>();
     await FluentActions.Invoking(async() => await _sut.Dispatch <IMessage>(null, null)).Should().ThrowAsync <Exception>();
 }
コード例 #9
0
ファイル: WhenDispatching.cs プロジェクト: brenpike/Chatter
 public async Task MustThrowWhenCommandBehaviorPipelineIsExecutedAndRaisesException()
 {
     _pipeline.Setup(p => p.Execute(It.IsAny <IMessage>(), It.IsAny <IMessageHandlerContext>(), It.IsAny <IMessageHandler <IMessage> >())).Throws <Exception>();
     await FluentActions.Invoking(async() => await _sut.Dispatch <IMessage>(null, null)).Should().ThrowAsync <Exception>();
 }
コード例 #10
0
 public void Should_throw_exception_if_area_is_less_than_four()
 {
     FluentActions.Invoking(() => new Plateau(0, 2)).Should().Throw <InvalidPlateauSizeException>();
 }
コード例 #11
0
 public void ImportCompleted()
 {
     FluentActions.Invoking(() => systemUnderTest.ImportCompleted())
     .Should()
     .NotThrow();
 }
コード例 #12
0
 public void Should_throw_exception_if_any_measurement_is_negative()
 {
     FluentActions.Invoking(() => new Plateau(-5, -5)).Should().Throw <InvalidPlateauSizeException>();
 }
コード例 #13
0
 public static void RequestArgumentNull() =>
 FluentActions
 .Invoking(() => ((IRequest <object>)null).WithQueryParams())
 .Should()
 .Throw <ArgumentNullException>();
コード例 #14
0
 public void ValidPostCode_For_InvalidPostcode_Throw_InvalidPostcode(string postCode)
 {
     FluentActions.Invoking(() => new Address("Opole", "Prószkowska", postCode, 76))
     .Should()
     .Throw <InvalidPostcode>();
 }
コード例 #15
0
 public void ValidIfNameExist_When_NotExist_Should_Throw_MissingValueException(string name)
 {
     FluentActions.Invoking(() => new Room(_area, name, 1))
     .Should()
     .Throw <MissingValueException>();
 }
コード例 #16
0
ファイル: WhenDispatching.cs プロジェクト: brenpike/Chatter
 public async Task MustThrowIfExceptionIsRaisedGettingCommandBehaviorPipelineFromServiceProvider()
 {
     _serviceProvider.Setup(p => p.GetService(typeof(ICommandBehaviorPipeline <IMessage>))).Throws <Exception>();
     await FluentActions.Invoking(async() => await _sut.Dispatch <IMessage>(null, null)).Should().ThrowAsync <Exception>();
 }
コード例 #17
0
 public void ValidIfPeopleCapacityIsPositive_When_Not_Should_Throw_MissingValueException(int peopleCapacity)
 {
     FluentActions.Invoking(() => new Room(_area, "p1", peopleCapacity))
     .Should()
     .Throw <HotelException>();
 }
コード例 #18
0
        public void MustThrowWhenTypeIsClosedGenericWithMultipleGenericTypeParameters()
        {
            var sc = new ServiceCollection();

            FluentActions.Invoking(() => sc.RegisterBehaviorForCommand(typeof(FakeCommandBehavior2 <FakeCommand, FakeCommand>))).Should().Throw <Exception>();
        }
コード例 #19
0
 public void Throw_Error_MoneyToExtract_Is_Null()
 {
     FluentActions.Invoking(() => _sut.ExtractMoney(null, DateTime.Now)).Should()
     .Throw <ArgumentException>()
     .WithMessage("Debe ingresar un monto (Parameter 'moneyToExtract')");
 }
コード例 #20
0
        public void MustThrowWhenTypeIsNotICommandBehavior()
        {
            var sc = new ServiceCollection();

            FluentActions.Invoking(() => sc.RegisterBehaviorForCommand(typeof(FakeCommandBehavior3 <NotACommand>))).Should().ThrowExactly <ArgumentException>();
        }
 public void ListViewItemComparerInstantiation()
 {
     FluentActions.Invoking(() => new ListViewItemComparer())
     .Should()
     .NotThrow();
 }
コード例 #22
0
        public void MustThrowWhenTypeIsNull()
        {
            var sc = new ServiceCollection();

            FluentActions.Invoking(() => sc.RegisterBehaviorForCommand(null)).Should().ThrowExactly <ArgumentNullException>();
        }
コード例 #23
0
 public void Should_throw_exception_if_MinDeliveryWorkingDays_is_higher_than_MaxDeliveryWorkingDays()
 {
     FluentActions.Invoking(() => new DeliveryTime(5, 1)).Should().Throw <InvalidMinDeliveryTimeException>();
 }
コード例 #24
0
ファイル: MassUnitTests.cs プロジェクト: xmesaj2/MyWarehouse
 public void FromSymbol_WithInCorrectSymbol_ThrowsArgumentException()
 {
     FluentActions.Invoking(() => MassUnit.FromSymbol("abcabc"))
     .Should().ThrowExactly <ArgumentException>();
 }
コード例 #25
0
 public void CrmGenericMigratorIntantiation()
 {
     FluentActions.Invoking(() => new CrmGenericMigratorFactory())
     .Should()
     .NotThrow();
 }
        public void ShouldRequireMinimumFields()
        {
            var query = new GetProjectIssuesListQuery();

            FluentActions.Invoking(() => SendAsync(query)).Should().Throw <NotFoundException>();
        }
コード例 #27
0
        public void ShouldRequireMinimumFields()
        {
            var command = new CreateTourPackageCommand();

            FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>();
        }
コード例 #28
0
 public void ValidIfAreaExist_When_NotExist_Should_Throw_MissingValueException()
 {
     FluentActions.Invoking(() => new Room(null, "p1", 1))
     .Should()
     .Throw <MissingValueException>();
 }
コード例 #29
0
 public void ShouldThrowAdAccountInvalidExceptionForInvalidAdAccount()
 {
     FluentActions.Invoking(() => (AdAccount)"SSWJason")
     .Should().Throw <AdAccountInvalidException>();
 }
コード例 #30
0
 public void ValidFlatNumber_For_NotPositiveNumber_Throw_NotPositiveFlatNumber(int flatNumber)
 {
     FluentActions.Invoking(() => new Address("Opole", "Prószkowska", "45-758", 1, flatNumber))
     .Should()
     .Throw <NotPositiveFlatNumber>();
 }