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

            FluentActions.Invoking(() => sut.CreateTasks(null)).Should().Throw <ArgumentNullException>();
        }
Beispiel #4
0
 public void SchemaGeneratorInstatiation()
 {
     FluentActions.Invoking(() => new SchemaWizard())
     .Should()
     .NotThrow();
 }
Beispiel #5
0
 public void Should_throw_exception_if_negative_value(int min, int max)
 {
     FluentActions.Invoking(() => new DeliveryTime(min, max)).Should().Throw <NegativeDeliveryTimeException>();
 }
 public void AppleAuthClient_NotValidArgument_ThrowArgumentException(AppleAuthSetting authSetting, IAppleTokenGenerator privateKeySetting, HttpClient httpClient)
 {
     FluentActions.Invoking(() => new AppleAuthClient(authSetting, privateKeySetting, httpClient)).Should().Throw <ArgumentException>();
 }
Beispiel #7
0
 public void Throw_Error_AccountToTransfer_Is_Null()
 {
     FluentActions.Invoking(() => _sut.TransferMoney(Option.None <AccountToTransfer>())).Should()
     .Throw <ArgumentException>();
 }
Beispiel #8
0
 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>();
 }
Beispiel #9
0
 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>();
 }
 public void Should_throw_exception_if_area_is_less_than_four()
 {
     FluentActions.Invoking(() => new Plateau(0, 2)).Should().Throw <InvalidPlateauSizeException>();
 }
Beispiel #11
0
 public void ImportCompleted()
 {
     FluentActions.Invoking(() => systemUnderTest.ImportCompleted())
     .Should()
     .NotThrow();
 }
 public void Should_throw_exception_if_any_measurement_is_negative()
 {
     FluentActions.Invoking(() => new Plateau(-5, -5)).Should().Throw <InvalidPlateauSizeException>();
 }
Beispiel #13
0
 public static void RequestArgumentNull() =>
 FluentActions
 .Invoking(() => ((IRequest <object>)null).WithQueryParams())
 .Should()
 .Throw <ArgumentNullException>();
Beispiel #14
0
 public void ValidPostCode_For_InvalidPostcode_Throw_InvalidPostcode(string postCode)
 {
     FluentActions.Invoking(() => new Address("Opole", "Prószkowska", postCode, 76))
     .Should()
     .Throw <InvalidPostcode>();
 }
Beispiel #15
0
 public void ValidIfNameExist_When_NotExist_Should_Throw_MissingValueException(string name)
 {
     FluentActions.Invoking(() => new Room(_area, name, 1))
     .Should()
     .Throw <MissingValueException>();
 }
Beispiel #16
0
 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>();
 }
Beispiel #17
0
 public void ValidIfPeopleCapacityIsPositive_When_Not_Should_Throw_MissingValueException(int peopleCapacity)
 {
     FluentActions.Invoking(() => new Room(_area, "p1", peopleCapacity))
     .Should()
     .Throw <HotelException>();
 }
Beispiel #18
0
        public void MustThrowWhenTypeIsClosedGenericWithMultipleGenericTypeParameters()
        {
            var sc = new ServiceCollection();

            FluentActions.Invoking(() => sc.RegisterBehaviorForCommand(typeof(FakeCommandBehavior2 <FakeCommand, FakeCommand>))).Should().Throw <Exception>();
        }
Beispiel #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')");
 }
Beispiel #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();
 }
Beispiel #22
0
        public void MustThrowWhenTypeIsNull()
        {
            var sc = new ServiceCollection();

            FluentActions.Invoking(() => sc.RegisterBehaviorForCommand(null)).Should().ThrowExactly <ArgumentNullException>();
        }
Beispiel #23
0
 public void Should_throw_exception_if_MinDeliveryWorkingDays_is_higher_than_MaxDeliveryWorkingDays()
 {
     FluentActions.Invoking(() => new DeliveryTime(5, 1)).Should().Throw <InvalidMinDeliveryTimeException>();
 }
Beispiel #24
0
 public void FromSymbol_WithInCorrectSymbol_ThrowsArgumentException()
 {
     FluentActions.Invoking(() => MassUnit.FromSymbol("abcabc"))
     .Should().ThrowExactly <ArgumentException>();
 }
Beispiel #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>();
        }
Beispiel #27
0
        public void ShouldRequireMinimumFields()
        {
            var command = new CreateTourPackageCommand();

            FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>();
        }
Beispiel #28
0
 public void ValidIfAreaExist_When_NotExist_Should_Throw_MissingValueException()
 {
     FluentActions.Invoking(() => new Room(null, "p1", 1))
     .Should()
     .Throw <MissingValueException>();
 }
 public void ShouldThrowAdAccountInvalidExceptionForInvalidAdAccount()
 {
     FluentActions.Invoking(() => (AdAccount)"SSWJason")
     .Should().Throw <AdAccountInvalidException>();
 }
Beispiel #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>();
 }