NUnit.Framework.Assert.That(NUnit.Framework.Constraints.ActualValueDelegate, NUnit.Framework.Constraints.IResolveConstraint)

Here are the examples of the csharp api class NUnit.Framework.Assert.That(NUnit.Framework.Constraints.ActualValueDelegate, NUnit.Framework.Constraints.IResolveConstraint) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

View license
[Test]
        public void TestCreateLabelMapForInvalidDataTypeShouldThrowArgumentException()
        {
            var column = new ColumnBuilder().WithDataType(typeof(Object)).Build();
            Assert.That(() => _factory.Create(column), Throws.ArgumentException);
        }

2. Example

Project: dataexplorer
Source File: ViewSerializerTests.cs
View license
[Test]
        public void TestDeserializeOtherViewViewShouldThrowException()
        {
            var xView = new XElement("other-view");
            Assert.That(() => _serializer.Deserialize(xView, _columns), Throws.ArgumentException);
        }

3. Example

View license
[Test]
        public void TestCreateWithInvalidTypeThrowsException()
        {
            Assert.That(() => _factory.Create(typeof(object), typeof(object)), Throws.ArgumentException);
        }

4. Example

Project: dataexplorer
Source File: ViewSerializerTests.cs
View license
[Test]
        public void TestSerializeOtherViewShouldThrowException()
        {
            var view = new FakeView();
            Assert.That(() => _serializer.Serialize(view), Throws.ArgumentException);
        }

5. Example

View license
[Test]
        public void TestCreateShouldThrowExceptionIfTypeIsNotSupported()
        {
            var column = new ColumnBuilder().WithDataType(typeof(Object)).Build();
            Assert.That(() => _factory.CreateRoot(column), Throws.ArgumentException);
        }

6. Example

Project: nmoneys
Source File: RangeTester.cs
View license
[Test]
		public void AssertArgument_HalfOpen_Contained_NoException()
		{
			var subject = new Range<int>(1.Close(), 5.Open());

			Assert.That(() => subject.AssertArgument("arg", 4), Throws.Nothing);
		}

7. Example

Project: nmoneys
Source File: RangeTester.cs
View license
[Test]
		public void AssertArgument_HalfClosed_Contained_NoException()
		{
			var subject = new Range<int>(1.Open(), 5.Close());

			Assert.That(() => subject.AssertArgument("arg", 4), Throws.Nothing);
		}

8. Example

Project: nmoneys
Source File: RangeTester.cs
View license
[Test]
		public void AssertArgument_Open_Contained_NoException()
		{
			var subject = new Range<int>(1.Open(), 5.Open());

			Assert.That(() => subject.AssertArgument("arg", 3), Throws.Nothing);
		}

9. Example

Project: nmoneys
Source File: RangeTester.cs
View license
[Test]
		public void AssertArgument_Closed_Contained_NoException()
		{
			var subject = new Range<int>(1.Close(), 5.Close());

			Assert.That(() => subject.AssertArgument("arg", 4), Throws.Nothing);
		}

10. Example

Project: nmoneys
Source File: GuardTester.cs
View license
[Test]
		public void AgainstArgumentNoMessage_FalseCondition_NoException()
		{
			Assert.That(() => Guard.AgainstArgument("param", "asd" == null), Throws.Nothing);
		}

11. Example

Project: nmoneys
Source File: GuardTester.cs
View license
[Test]
		public void AgainstArgument_FalseCondition_NoException()
		{
			Assert.That(() => Guard.AgainstArgument("param", "asd" == null, "no Exception"), Throws.Nothing);
		}

12. Example

View license
[Test]
        public void Opening_DropDown_Should_Not_Throw_When_GalleryPanel_Has_No_Width()
        {
            var control = new InRibbonGallery
                          {
                              Width = 10,
                              Height = 30
                          };

            using (new TestRibbonWindow(control))
            {
                Assert.That(() => control.IsDropDownOpen = true, Throws.Nothing);
            }
        }

13. Example

Project: simple-container
Source File: BasicTest.cs
View license
[Test]
			public void Test()
			{
				var container = Container();
				Assert.That(() => container.Get<C>(), Throws.Nothing);
			}

14. Example

View license
[Test]
			public void Test()
			{
				var container = Container();
				Assert.That(() => container.Get<A>(), Throws.Nothing);
			}

15. Example

View license
[Test]
			public void Test()
			{
				var container = Container();
				Assert.That(() => container.Get<AWrap>(), Throws.Nothing);
			}

16. Example

Project: Shovel
Source File: TaskTests.cs
View license
[Test]
		public void TaskWithNoActionDefinedDoesNotFailWhenRun()
		{
			var task = new Task("task-with-no-action", t => { }, new TaskActionFactory());
			Assert.That(() => task.Run(), Throws.Nothing);
		}

17. Example

Project: Shovel
Source File: TaskTests.cs
View license
[Test]
		public void TaskWithNoPreExecutorDefinedDoesNotFailWhenRun()
		{
			var task = new Task("task-with-no-action", null, new TaskActionFactory());
			task.Do(() => { });
			Assert.That(() => task.Run(), Throws.Nothing);
		}

18. Example

Project: DarkSkyApi
Source File: ApiTests.cs
View license
[Test]
        public void EmptyKeyThrowsException()
        {
            var client = new DarkSkyService(string.Empty);
            Assert.That(async () => await client.GetWeatherDataAsync(AlcatrazLatitude, AlcatrazLongitude), Throws.InvalidOperationException);
        }

19. Example

Project: DarkSkyApi
Source File: ApiTests.cs
View license
[Test]
        public void NullKeyThrowsException()
        {
            var client = new DarkSkyService(null);
            Assert.That(async () => await client.GetWeatherDataAsync(AlcatrazLatitude, AlcatrazLongitude), Throws.InvalidOperationException);
        }

20. Example

Project: Turnable
Source File: StatManagerTests.cs
View license
[Test]
        public void BuildStat_BuildingAStatThatAlreadyExistsDifferingByCaseForName_ThrowsException()
        {
            _statManager.BuildStat("Health", 100);
            Assert.That(() => _statManager.BuildStat("HEALTH", 100), Throws.ArgumentException);
        }

21. Example

Project: Turnable
Source File: LineSegmentTests.cs
View license
[Test]
        public void DistanceBetween_GivenTwoSegmentsThatAreNotParallel_ThrowsAnException()
        {
            LineSegment first = new LineSegment(new Position(0, 0), new Position(0, 4));
            LineSegment second = new LineSegment(new Position(0, 0), new Position(4, 0));

            Assert.That(() => first.DistanceBetween(second), Throws.ArgumentException);
        }

22. Example

Project: Turnable
Source File: ElementListTests.cs
View license
[Test]
        public void Add_WhenAnElementWithTheSameNameAlreadyExists_ThrowsAnException()
        {
            Layer layer = TiledFactory.BuildLayer();

            _elementList.Add(layer);
            Assert.That(() => _elementList.Add(layer), Throws.ArgumentException);
        }

23. Example

Project: Turnable
Source File: StatManagerTests.cs
View license
[Test]
        public void BuildStat_BuildingAStatThatAlreadyExists_ThrowsException()
        {
            _statManager.BuildStat("Health", 100);
            Assert.That(() => _statManager.BuildStat("Health", 100), Throws.ArgumentException);
        }

24. Example

View license
[Test]
        public void SubtractingScalarWithWrongSizeResultVectorThrowsArgumentException()
        {
            var vector = CreateVector(Data.Length);
            var result = CreateVector(Data.Length + 1);
            Assert.That(() => vector.Subtract(0.0, result), Throws.ArgumentException);
        }

25. Example

View license
[Test]
        public void CholeskyFailsWithNonSquareMatrix()
        {
            var matrixI = new UserDefinedMatrix(3, 2);
            Assert.That(() => matrixI.Cholesky(), Throws.ArgumentException);
        }

26. Example

Project: mathnet-numerics
Source File: HistogramTests.cs
View license
[Test]
        public void EmptyBucketWithBadBoundsFails()
        {
            Assert.That(() => new Bucket(1.0, 0.5), Throws.ArgumentException);
        }

27. Example

View license
[Test]
        public void SubtractionOperatorIfVectorsAreDifferentSizeThrowsArgumentException()
        {
            var a = CreateVector(Data.Length);
            var b = CreateVector(Data.Length + 1);
            Assert.That(() => a -= b, Throws.ArgumentException);
        }

28. Example

View license
[Test]
        public void SubtractionOperatorIfVectorsAreDifferentSizeThrowsArgumentException()
        {
            var a = CreateVector(Data.Length);
            var b = CreateVector(Data.Length + 1);
            Assert.That(() => a -= b, Throws.ArgumentException);
        }

29. Example

View license
[Test]
        public void DotProductWhenDifferentSizeThrowsArgumentException()
        {
            var dataA = CreateVector(Data);
            var dataB = CreateVector(new float[] { 1, 2, 3, 4, 5, 6 });

            Assert.That(() => dataA.DotProduct(dataB), Throws.ArgumentException);
        }

30. Example

View license
[Test]
        public void DotProductWhenDifferentSizeThrowsArgumentException()
        {
            var dataA = CreateVector(Data);
            var dataB = CreateVector(new[] { new Complex32(1, 1), new Complex32(2, 1), new Complex32(3, 1), new Complex32(4, 1), new Complex32(5, 1), new Complex32(6, 1) });

            Assert.That(() => dataA.DotProduct(dataB), Throws.ArgumentException);
        }

31. Example

View license
[Test]
        public void CholeskyFailsWithNonSquareMatrix()
        {
            var matrixI = new UserDefinedMatrix(3, 2);
            Assert.That(() => matrixI.Cholesky(), Throws.ArgumentException);
        }

32. Example

View license
[Test]
        public void NegateIntoResultWithMoreColumnsThrowsArgumentException()
        {
            var matrix = TestMatrices["Singular3x3"];
            var target = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount);
            Assert.That(() => matrix.Negate(target), Throws.ArgumentException);
        }

33. Example

View license
[Test]
        public void MultiplyWithVectorIntoLargerResultThrowsArgumentException()
        {
            var matrix = TestMatrices["Singular3x3"];
            var x = new DenseVector(new[] { new Complex(1, 1), new Complex(2, 1), new Complex(3, 1) });
            Vector<Complex> y = new DenseVector(4);
            Assert.That(() => matrix.Multiply(x, y), Throws.ArgumentException);
        }

34. Example

Project: mathnet-numerics
Source File: BetaScaledTests.cs
View license
[Test]
        public void BetaScaledCreateFailsWithBadParameters()
        {
            Assert.That(() => new BetaScaled(Double.NaN, 1.0, 0.0, 1.0), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(1.0, Double.NaN, 0.0, 1.0), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(Double.NaN, Double.NaN, 0.0, 1.0), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(1.0, 1.0, Double.NaN, 1.0), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(1.0, 1.0, 1.0, Double.NaN), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(1.0, 0.0, 0.0, 1.0), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(0.0, 1.0, 0.0, 1.0), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(-1.0, -1.0, 0.0, 1.0), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(1.0, 1.0, 1.0, 0.0), Throws.ArgumentException);
            Assert.That(() => new BetaScaled(1.0, 1.0, 1.0, -1.0), Throws.ArgumentException);
        }

35. Example

Project: mathnet-numerics
Source File: RayleighTests.cs
View license
[TestCase(Double.NaN)]
        [TestCase(Double.NegativeInfinity)]
        [TestCase(-1.0)]
        [TestCase(0.0)]
        public void RayleighCreateFailsWithBadParameters(double scale)
        {
            Assert.That(() => new Rayleigh(scale), Throws.ArgumentException);
        }

36. Example

View license
[Test]
        public void SubtractingTwoVectorsAndResultIsDifferentSizeThrowsArgumentException()
        {
            var vector = CreateVector(Data.Length);
            var other = CreateVector(Data.Length);
            var result = CreateVector(Data.Length + 1);
            Assert.That(() => vector.Subtract(other, result), Throws.ArgumentException);
        }

37. Example

Project: mathnet-numerics
Source File: PalfTests.cs
View license
[Test]
        public void ThrowsArgumentExceptionWhenShortLagIsNonPositive()
        {
            Assert.That(() => new Palf(1, true, 0, 10), Throws.ArgumentException);
        }

38. Example

View license
[Test]
        public void SubtractingTwoVectorsOfDifferingSizeThrowsArgumentException()
        {
            var vector = CreateVector(Data.Length);
            var other = CreateVector(Data.Length + 1);
            Assert.That(() => vector.Subtract(other), Throws.ArgumentException);
        }

39. Example

View license
[Test]
        public void AddingTwoVectorsOfDifferentSizeThrowsArgumentException()
        {
            var vector = CreateVector(Data.Length);
            var other = CreateVector(Data.Length + 1);
            Assert.That(() => vector.Add(other), Throws.ArgumentException);
        }

40. Example

Project: mathnet-numerics
Source File: GammaTests.cs
View license
[TestCase(1.0, Double.NaN)]
        [TestCase(1.0, -1.0)]
        [TestCase(-1.0, 1.0)]
        [TestCase(-1.0, -1.0)]
        [TestCase(-1.0, Double.NaN)]
        public void GammaCreateFailsWithBadParameters(double shape, double invScale)
        {
            Assert.That(() => new Gamma(shape, invScale), Throws.ArgumentException);
        }

41. Example

View license
[TestCase(Double.NaN, Double.NaN)]
        [TestCase(0.0, Double.NaN)]
        [TestCase(-1.0, Double.NaN)]
        [TestCase(-10.0, Double.NaN)]
        [TestCase(Double.NaN, 0.0)]
        [TestCase(0.0, 0.0)]
        [TestCase(-1.0, 0.0)]
        [TestCase(-10.0, 0.0)]
        [TestCase(Double.NaN, -1.0)]
        [TestCase(0.0, -1.0)]
        [TestCase(-1.0, -1.0)]
        [TestCase(-10.0, -1.0)]
        [TestCase(Double.NaN, -10.0)]
        [TestCase(0.0, -10.0)]
        [TestCase(-1.0, -10.0)]
        [TestCase(-10.0, -10.0)]
        public void FisherSnedecorCreateFailsWithBadParameters(double d1, double d2)
        {
            Assert.That(() => new FisherSnedecor(d1, d2), Throws.ArgumentException);
        }

42. Example

View license
[Test]
        public void TransposeThisAndMultiplyWithVectorIntoLargerResultThrowsArgumentException()
        {
            var matrix = TestMatrices["Singular3x3"];
            var x = new DenseVector(new[] { new Complex32(1, 1), new Complex32(2, 1), new Complex32(3, 1) });
            Vector<Complex32> y = new DenseVector(4);
            Assert.That(() => matrix.TransposeThisAndMultiply(x, y), Throws.ArgumentException);
        }

43. Example

Project: mathnet-numerics
Source File: TriangularTests.cs
View license
[TestCase(0.0, 1.0, -0.1)]
        [TestCase(0.0, 1.0, 1.1)]
        [TestCase(0.0, -1.0, 0.5)]
        [TestCase(2.0, 1.0, 1.5)]
        [TestCase(Double.NaN, 1.0, 0.5)]
        [TestCase(0.2, Double.NaN, 0.5)]
        [TestCase(0.5, 1.0, Double.NaN)]
        [TestCase(Double.NaN, Double.NaN, Double.NaN)]
        [TestCase(Double.NegativeInfinity, 1.0, 0.5)]
        [TestCase(0.0, Double.PositiveInfinity, 0.5)]
        public void TriangularCreateFailsWithBadParameters(double lower, double upper, double mode)
        {
            Assert.That(() => new Triangular(lower, upper, mode), Throws.ArgumentException);
        }

44. Example

View license
[Test]
        public void TransposeThisAndMultiplyWithVectorIntoLargerResultThrowsArgumentException()
        {
            var matrix = TestMatrices["Singular3x3"];
            var x = new DenseVector(new[] { new Complex(1, 1), new Complex(2, 1), new Complex(3, 1) });
            Vector<Complex> y = new DenseVector(4);
            Assert.That(() => matrix.TransposeThisAndMultiply(x, y), Throws.ArgumentException);
        }

45. Example

View license
[Test]
        public void PointwiseMultiplyWithInvalidDimensionsIntoResultThrowsArgumentException()
        {
            var matrix = TestMatrices["Wide2x3"];
            var other = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount);
            var result = matrix.Clone();
            Assert.That(() => matrix.PointwiseMultiply(other, result), Throws.ArgumentException);
        }

46. Example

View license
[TestCase(0.0, Double.NaN)]
        [TestCase(0.0, -1.0)]
        [TestCase(0.0, 2.0)]
        [TestCase(Double.NegativeInfinity, 0.0)]
        [TestCase(-1.0, 0.3)]
        [TestCase(Double.NaN, 1.0)]
        [TestCase(Double.NegativeInfinity, Double.NaN)]
        [TestCase(Double.NaN, Double.NaN)]
        public void NegativeBinomialCreateFailsWithBadParameters(double r, double p)
        {
            Assert.That(() => new NegativeBinomial(r, p), Throws.ArgumentException);
        }

47. Example

View license
[Test]
        public void AddingScalarWithWrongSizeResultVectorThrowsArgumentException()
        {
            var vector = CreateVector(Data.Length);
            var result = CreateVector(Data.Length + 1);
            Assert.That(() => vector.Add(0.0f, result), Throws.ArgumentException);
        }

48. Example

View license
[Test]
        public void NegateIntoResultWithMoreRowsThrowsArgumentException()
        {
            var matrix = TestMatrices["Singular3x3"];
            var target = CreateMatrix(matrix.RowCount + 1, matrix.ColumnCount);
            Assert.That(() => matrix.Negate(target), Throws.ArgumentException);
        }

49. Example

Project: mathnet-numerics
Source File: WeibullTests.cs
View license
[TestCase(Double.NaN, 1.0)]
        [TestCase(1.0, Double.NaN)]
        [TestCase(Double.NaN, Double.NaN)]
        [TestCase(1.0, -1.0)]
        [TestCase(-1.0, 1.0)]
        [TestCase(-1.0, -1.0)]
        [TestCase(0.0, 0.0)]
        [TestCase(0.0, 1.0)]
        [TestCase(1.0, 0.0)]
        public void WeibullCreateFailsWithBadParameters(double shape, double scale)
        {
            Assert.That(() => new Weibull(shape, scale), Throws.ArgumentException);
        }

50. Example

Project: mathnet-numerics
Source File: NormalTests.cs
View license
[TestCase(Double.NaN, 1.0)]
        [TestCase(1.0, Double.NaN)]
        [TestCase(Double.NaN, Double.NaN)]
        [TestCase(1.0, -1.0)]
        public void NormalCreateFailsWithBadParameters(double mean, double sdev)
        {
            Assert.That(() => new Normal(mean, sdev), Throws.ArgumentException);
        }