示例#1
0
 public void Should_throw_for_async_void_send()
 {
     Should.Throw <InvalidOperationException>(() => _mediator.SendAsync(new AsyncVoidPing()));
 }
示例#2
0
 public void Non_digits_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsPhoneNumber("123A45"))
     .ErrorCode.ShouldBe(OriginatorErrorCode.NonNumeric);
 }
示例#3
0
 public void Empty_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsShortCode(string.Empty))
     .ErrorCode.ShouldBe(OriginatorErrorCode.Empty);
 }
示例#4
0
 public void Twelve_digits_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsAlpha("AbCZz12h39QX"))
     .ErrorCode.ShouldBe(OriginatorErrorCode.TooLong);
 }
示例#5
0
 public void Leading_zero_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsPhoneNumber("0123"))
     .ErrorCode.ShouldBe(OriginatorErrorCode.LeadingZero);
 }
 private void ExecuteUsingReflectingScanners()
 {
     var ex = Should.Throw<Exception>(() => Sut.Execute(ThrowingMethods.When, false));
     ex.GetType().FullName.ShouldContain("Inconclusive");
 }
示例#7
0
 public void When_creating_batch_from_list_with_buckets_of_size_zero() =>
 Should.Throw <ArgumentOutOfRangeException>(() => new List <int>().Batch(0).ToArray())
 .Message.ShouldBe("Specified argument was out of the range of valid values. (Parameter 'size')");
示例#8
0
        public void FailIfDiscriminatorIsTooLong()
        {
            configuration.UseTypeMapper(new OtherTypeMapper(string.Join("", Enumerable.Repeat("A", 1025))));

            Should.Throw <InvalidOperationException>(() => configuration.Document <Entity>());
        }
 public void coerces_input_to_exception(string input)
 {
     FormatException formatException = Should.Throw<FormatException>(() => type.ParseValue(input));
     formatException.Message.ShouldBe("String was not recognized as a valid Boolean.");
 }
示例#10
0
 public void FailWhenTryingtoOverrideIdProjection()
 {
     Should.Throw <ArgumentException>(() => configuration.Document <Entity>().With("Id", x => x.String));
 }
示例#11
0
 public void FailsIfEntityTypeIsUnknown()
 {
     Should.Throw <HybridDbException>(() => configuration.GetDesignFor <int>());
 }
示例#12
0
 public void FailWhenSettingTypeMapperTooLate()
 {
     configuration.Document <Entity>();
     Should.Throw <InvalidOperationException>(() => configuration.UseTypeMapper(new OtherTypeMapper("MySiscriminator")));
 }
示例#13
0
        public void FailsWhenTryingToAddNewTableAfterInitialize()
        {
            configuration.Initialize();

            Should.Throw <InvalidOperationException>(() => configuration.GetOrCreateDesignFor(typeof(OtherEntity), "allnewtable"));
        }
示例#14
0
        public void RegisterBaseTypeAfterDerivedTypeBeforeInitialize()
        {
            configuration.Document <MoreDerivedEntity1>();

            Should.Throw <InvalidOperationException>(() => configuration.Document <DerivedEntity>());
        }
示例#15
0
 public void parsing_a_null_address_will_throw()
 {
     Should.Throw<ArgumentNullException>(() => Address.ParseFormatName(null));
 }
示例#16
0
        public void Test001()
        {
            var cut = RenderComponent <Wrapper>();

            Should.Throw <ElementNotFoundException>(() => cut.Find("div"));
        }
 private void ExecuteUsingFluentScanner()
 {
     var ex = Should.Throw<Exception>(() => Sut.Execute(ThrowingMethods.When, true));
     ex.GetType().FullName.ShouldContain("Inconclusive");
 }
示例#18
0
 public void Throws_if_collection_is_null(IList <int> collection)
 {
     Should.Throw <ArgumentNullException>(() => collection.Shuffle());
 }
示例#19
0
 public override void Page_ForPocoSqlWithOrderByParameterPageItemAndPerPage_ShouldReturnValidPocoCollection()
 {
     Should.Throw <NotSupportedException>(() => base.Page_ForPocoGivenSqlWithoutOrderByParameterPageItemAndPerPage_ShouldReturnValidPocoCollection());
 }
示例#20
0
 public void Throws_if_iterations_is_less_than_one(IList <int> collection)
 {
     Should.Throw <ArgumentOutOfRangeException>(() => collection.Shuffle(0));
     Should.Throw <ArgumentOutOfRangeException>(() => collection.Shuffle(-1));
 }
示例#21
0
 public void Null_is_invalid()
 {
     Should.Throw <ArgumentNullException>(() => Originator.AsPhoneNumber(null));
 }
示例#22
0
 public void GetNextHost_LocalhostFallbackOff_AfterRefreshNoEndpoints_Throws()
 {
     CreatePool("host1, host2, host3");
     ChangeConfig("");
     Should.Throw <EnvironmentException>(() => Pool.GetNextHost());
 }
示例#23
0
 public void Non_Supported_chars_when_strict_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsAlpha("Café", true))
     .ErrorCode.ShouldBe(OriginatorErrorCode.UnsupportedChars);
 }
示例#24
0
 public void CombineWithNullSecondThrows()
 {
     Should.Throw <ArgumentNullException>(() => Validator.Combine <IValidator <int> >(null, null));
 }
示例#25
0
 public void Sixteen_digits_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsPhoneNumber("1234567890123456"))
     .ErrorCode.ShouldBe(OriginatorErrorCode.TooLong);
 }
示例#26
0
 public void parsing_a_wrong_formatname_will_throw()
 {
     Should.Throw<InvalidOperationException>(() => Address.ParseFormatName("[email protected]"));
 }
示例#27
0
 public void Null_is_invalid()
 {
     Should.Throw <ArgumentNullException>(() => Originator.AsShortCode(null));
 }
示例#28
0
 public void parsing_an_empty_address_will_throw()
 {
     Should.Throw<InvalidOperationException>(() => Address.ParseFormatName(""));
 }
示例#29
0
 public void RemountImageTest_ThrowsDirectoryNotFoundException_mountPath()
 {
     Should.Throw <DirectoryNotFoundException>(() =>
                                               WimgApi.RemountImage(Path.Combine(TestDirectory, Guid.NewGuid().ToString())));
 }
示例#30
0
 public void Should_throw_for_send()
 {
     Should.Throw <InvalidOperationException>(() => _mediator.Send(new Ping()));
 }