public void ConstructorTimingNull() { Assert.That(() => new AdaptiveTiming(null), Throws.TypeOf <ArgumentNullException>()); }
public void TestInstantiateWithInvalidDecoder() { Assert.That(() => new Mpg123("foobar"), Throws.TypeOf <Mpg123.ErrorException>()); }
public void Should_not_be_handled_on_initial() { var instance = new Instance(); Assert.That(async() => await _machine.RaiseEvent(instance, x => x.Hello), Throws.TypeOf <UnhandledEventException>()); Assert.IsFalse(instance.HelloCalled); Assert.AreEqual(_machine.Initial, instance.CurrentState); }
public void WhenCreateWithNullHbmJoinThenThrows() { var mapdoc = new HbmMapping(); Assert.That(() => new JoinMapper(typeof(MyClass), "AA", null, mapdoc), Throws.TypeOf <ArgumentNullException>()); }
public void Should_receive_the_exception() { Assert.That(async() => await _requestClient.GetResponse <PongMessage>(new PingMessage()), Throws.TypeOf <RequestFaultException>()); }
public void WithoutMissingMembers() { DocumentBuilder builder = new DocumentBuilder(); //Add templete to the document for reporting engine DocumentHelper.InsertBuilderText(builder, new[] { "<<[missingObject.First().id]>>", "<<foreach [in missingObject]>><<[id]>><</foreach>>" }); //Assert that build report failed without "ReportBuildOptions.AllowMissingMembers" Assert.That(() => BuildReport(builder.Document, new DataSet(), "", ReportBuildOptions.None), Throws.TypeOf <InvalidOperationException>()); }
public void ThrowArgumentException_WhenIncorrectArgs(int precision, int scale, bool onlyPositive) { Assert.That(() => new NumberValidator(precision, scale, onlyPositive), Throws.TypeOf <ArgumentException>()); }
public void CreateSiteOnDb_TooLong_name_Throws() { Assert.That(() => siteFactory.CreateSiteOnDb(connectionString, "MP6rVLwFsoy1WYITJjrY1oETEy3kvLRkMCAAZvikN47O8h6ak8dYSS1eh9a2SOslqeXbOW6ry63oqwyUu8N4MmjYY7FHO5aJ9OjwvTosg9Tdc5Xxlu1gpmM13lME1wUTm", 1, 600, 0.01), Throws.TypeOf <ArgumentException>()); }
public void GetTheTimezoneOf_TooShort_name_Throws() { Assert.That(() => siteFactory.GetTheTimezoneOf(connectionString, ""), Throws.TypeOf <ArgumentException>()); }
public void CreateSiteOnDb_ZeroSessionExpirationTime_Throws() { Assert.That(() => siteFactory.CreateSiteOnDb(connectionString, "troppo giusto", 1, 0, 0.01), Throws.TypeOf <ArgumentOutOfRangeException>()); }
public void CreateSiteOnDb_TooShort_name_Throws() { Assert.That(() => siteFactory.CreateSiteOnDb(connectionString, "", 1, 600, 0.01), Throws.TypeOf <ArgumentException>()); }
public void CreateSiteOnDb_ZeroMinimumBidIncrement_Throws() { Assert.That(() => siteFactory.CreateSiteOnDb(connectionString, "troppo giusto", 1, 600, 0), Throws.TypeOf <ArgumentOutOfRangeException>()); }
public void LoadSite_TooShort_name_Throws() { Assert.That(() => siteFactory.LoadSite(connectionString, "", _alarmClockMock.Object), Throws.TypeOf <ArgumentException>()); }
public static void AddWithNull() { var style = new CSharpSpaceBetweenMethodDeclarationParameterListParenthesesStyle(new BooleanData()); Assert.That(() => style.Add(null !), Throws.TypeOf <ArgumentNullException>()); }
public void Division(int num1, int num2, int resultado) { Assert.AreEqual(resultado, iCalculadora.Division(num1, num2)); Throws.TypeOf <DivideByZeroException>(); }
public static void GetId_with_bad_name_Throws() { var realTool = MakeRealTool(); Assert.That(() => realTool.GetId("ABC123"), Throws.TypeOf <KeyNotFoundException>()); }
public void DivisionByZero(int num1, int num2) { Assert.That(() => iCalculadora.Division(num1, num2), Throws.TypeOf <DivideByZeroException>()); }
public void CopyById_throws() { Assert.That(() => _fakeTool.Copy(1, "new"), Throws.TypeOf <NotImplementedException>()); }
public void Rectangle_Parse_FailsForInvalidStrings() { Assert.That(() => Rectangle.Parse("foo"), Throws.TypeOf <FormatException>()); }
public void Create_throws( [Values(null, "", " ")] string input) { Assert.That(() => _fakeTool.Create(input), Throws.TypeOf <ArgumentException>()); }
public void WhenCreateWithEmptySplitGroupThenThrows() { var mapdoc = new HbmMapping(); var hbmJoin = new HbmJoin(); Assert.That(() => new JoinMapper(typeof(MyClass), null, hbmJoin, mapdoc), Throws.TypeOf <ArgumentNullException>()); Assert.That(() => new JoinMapper(typeof(MyClass), "", hbmJoin, mapdoc), Throws.TypeOf <ArgumentOutOfRangeException>()); Assert.That(() => new JoinMapper(typeof(MyClass), " ", hbmJoin, mapdoc), Throws.TypeOf <ArgumentOutOfRangeException>()); }
public void Get_by_id_throws( ) { Assert.That(() => _fakeTool.Get(Guid.Empty), Throws.TypeOf <ArgumentException>()); }
public void Should_timeout() { Assert.That(async() => await _requestClient.GetResponse <PongMessage>(new PingMessage()), Throws.TypeOf <RequestTimeoutException>()); }
public void Get_by_name_throws( [Values(null, "", " ")] string name ) { Assert.That(() => _fakeTool.Get(name), Throws.TypeOf <ArgumentException>()); }
public void Throws_on_invalid_arguments() { Assert.That( () => Task.Run(() => ((TestInMemoryDatabase)Database).Database.RemoveAllCommandAsync(" ")).Wait(), Throws.TypeOf <AggregateException>().With.InnerException.TypeOf <ArgumentNullException>()); }
public void ReadEmailGroupFromXmlUsingInvalidNotificationType() { Assert.That(delegate { NetReflector.Read(@"<group> name=""foo"" <notifications><NotificationType>bar</NotificationType></notifications> </group>"); }, Throws.TypeOf <NetReflectorException>()); }
public static void Ctor_GivenNegativeColumnOrder_ThrowsArgumentOutOfRangeException() { Assert.That(() => new ColumnOrderAttribute(-1), Throws.TypeOf <ArgumentOutOfRangeException>()); }
public void ProcessResponseThrowsAnExceptionForUnknownMessage() { Assert.That(delegate { XmlConversionUtil.ProcessResponse("<garbage/>"); }, Throws.TypeOf <CommunicationsException>()); }
public void MissingDirectoryThrowsException() { Assert.IsFalse(tempRoot.Exists(), "Temporary directory should not exist: " + tempRoot.ToString()); Assert.That(delegate { sc.GetModifications(IntegrationResult(DateTime.MinValue), IntegrationResult(DateTime.MaxValue)); }, Throws.TypeOf <DirectoryNotFoundException>()); }
public void CreateWithIllegalMinimumIterationsThrowsArgumentOutOfRangeException() { Assert.That(() => new DivergenceStopCriterion <double>(minimumIterations: 2), Throws.TypeOf <ArgumentOutOfRangeException>()); }