Here are the examples of the csharp api class NUnit.Framework.Assert.That(bool) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
200 Examples
0
1. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test] public void SingleArgument( [Values(1.3, 1.7, 1.5)] double x) { Assert.That(x > 1.0 && x < 2.0); }
0
2. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Combinatorial] public void TwoArguments_Combinatorial( [Values(1, 2, 3)] int x, [Values(10, 20)] int y) { Assert.That(x > 0 && x < 4 && y % 10 == 0); }
0
3. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Sequential] public void TwoArguments_Sequential( [Values(1, 2, 3)] int x, [Values(10, 20)] int y) { Assert.That(x > 0 && x < 4 && y % 10 == 0); }
0
4. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Combinatorial] public void ThreeArguments_Combinatorial( [Values(1, 2, 3)] int x, [Values(10, 20)] int y, [Values("Charlie", "Joe", "Frank")] string name) { Assert.That(x > 0 && x < 4 && y % 10 == 0); Assert.That(name.Length >= 2); }
0
5. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Sequential] public void ThreeArguments_Sequential( [Values(1, 2, 3)] int x, [Values(10, 20)] int y, [Values("Charlie", "Joe", "Frank")] string name) { Assert.That(x > 0 && x < 4 && y % 10 == 0); Assert.That(name.Length >= 2); }
0
6. Example
Project: ContinuousTests
Source File: ParameterizedTestFixtureTests.cs
Source File: ParameterizedTestFixtureTests.cs
[Test] public void CanAccessValueSource( [ValueSource("intvals")] int x) { Assert.That(answer % x == 0); }
0
7. Example
Project: ContinuousTests
Source File: TestCaseSourceTests.cs
Source File: TestCaseSourceTests.cs
[Test, TestCaseSource("CheckCurrentDirectory")] public void SourceIsInvokedWithCorrectCurrentDirectory(bool isOK) { Assert.That(isOK); }
0
8. Example
Project: ContinuousTests
Source File: ValueSourceTests.cs
Source File: ValueSourceTests.cs
[Test] public void ValueSourceIsInvokedWithCorrectCurrentDirectory( [ValueSource("CheckCurrentDirectory")] bool isOK) { Assert.That(isOK); }
0
9. Example
Project: ContinuousTests
Source File: TestFixtureAttributeTests.cs
Source File: TestFixtureAttributeTests.cs
[Test] public void ConstructWithoutArguments() { TestFixtureAttribute attr = new TestFixtureAttribute(); Assert.That(attr.Arguments.Length == 0); #if NET_2_0 Assert.That(attr.TypeArgs.Length == 0); #endif }
0
10. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test] public void SingleArgument( [Values(1.3, 1.7, 1.5)] double x) { Assert.That(x > 1.0 && x < 2.0); }
0
11. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Combinatorial] public void TwoArguments_Combinatorial( [Values(1, 2, 3)] int x, [Values(10, 20)] int y) { Assert.That(x > 0 && x < 4 && y % 10 == 0); }
0
12. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Sequential] public void TwoArguments_Sequential( [Values(1, 2, 3)] int x, [Values(10, 20)] int y) { Assert.That(x > 0 && x < 4 && y % 10 == 0); }
0
13. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Combinatorial] public void ThreeArguments_Combinatorial( [Values(1, 2, 3)] int x, [Values(10, 20)] int y, [Values("Charlie", "Joe", "Frank")] string name) { Assert.That(x > 0 && x < 4 && y % 10 == 0); Assert.That(name.Length >= 2); }
0
14. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Sequential] public void ThreeArguments_Sequential( [Values(1, 2, 3)] int x, [Values(10, 20)] int y, [Values("Charlie", "Joe", "Frank")] string name) { Assert.That(x > 0 && x < 4 && y % 10 == 0); Assert.That(name.Length >= 2); }
0
15. Example
Project: ContinuousTests
Source File: ParameterizedTestFixtureTests.cs
Source File: ParameterizedTestFixtureTests.cs
[Test] public void CanAccessValueSource( [ValueSource("intvals")] int x) { Assert.That(answer % x == 0); }
0
16. Example
Project: ContinuousTests
Source File: TestCaseSourceTests.cs
Source File: TestCaseSourceTests.cs
[Test, TestCaseSource("CheckCurrentDirectory")] public void SourceIsInvokedWithCorrectCurrentDirectory(bool isOK) { Assert.That(isOK); }
0
17. Example
Project: ContinuousTests
Source File: TestExecutionContextTests.cs
Source File: TestExecutionContextTests.cs
[Test, Explicit("Run this test manually with PrincipalPolicy set to WindowsPrincipal in the advanced loader settings")] public void CanSetPrincipalPolicy() { Assert.That(Thread.CurrentPrincipal is WindowsPrincipal); }
0
18. Example
Project: ContinuousTests
Source File: ValueSourceTests.cs
Source File: ValueSourceTests.cs
[Test] public void ValueSourceIsInvokedWithCorrectCurrentDirectory( [ValueSource("CheckCurrentDirectory")] bool isOK) { Assert.That(isOK); }
0
19. Example
Project: ContinuousTests
Source File: TestFixtureAttributeTests.cs
Source File: TestFixtureAttributeTests.cs
[Test] public void ConstructWithoutArguments() { TestFixtureAttribute attr = new TestFixtureAttribute(); Assert.That(attr.Arguments.Length == 0); #if CLR_2_0 || CLR_4_0 Assert.That(attr.TypeArgs.Length == 0); #endif }
0
20. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test] public void SingleArgument( [Values(1.3, 1.7, 1.5)] double x) { Assert.That(x > 1.0 && x < 2.0); }
0
21. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Combinatorial] public void TwoArguments_Combinatorial( [Values(1, 2, 3)] int x, [Values(10, 20)] int y) { Assert.That(x > 0 && x < 4 && y % 10 == 0); }
0
22. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Sequential] public void TwoArguments_Sequential( [Values(1, 2, 3)] int x, [Values(10, 20)] int y) { Assert.That(x > 0 && x < 4 && y % 10 == 0); }
0
23. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Combinatorial] public void ThreeArguments_Combinatorial( [Values(1, 2, 3)] int x, [Values(10, 20)] int y, [Values("Charlie", "Joe", "Frank")] string name) { Assert.That(x > 0 && x < 4 && y % 10 == 0); Assert.That(name.Length >= 2); }
0
24. Example
Project: ContinuousTests
Source File: CombinatorialTests.cs
Source File: CombinatorialTests.cs
[Test, Sequential] public void ThreeArguments_Sequential( [Values(1, 2, 3)] int x, [Values(10, 20)] int y, [Values("Charlie", "Joe", "Frank")] string name) { Assert.That(x > 0 && x < 4 && y % 10 == 0); Assert.That(name.Length >= 2); }
0
25. Example
Project: ContinuousTests
Source File: ParameterizedTestFixtureTests.cs
Source File: ParameterizedTestFixtureTests.cs
[Test] public void CanAccessValueSource( [ValueSource("intvals")] int x) { Assert.That(answer % x == 0); }
0
26. Example
Project: ContinuousTests
Source File: TestCaseSourceTests.cs
Source File: TestCaseSourceTests.cs
[Test, TestCaseSource("CheckCurrentDirectory")] public void SourceIsInvokedWithCorrectCurrentDirectory(bool isOK) { Assert.That(isOK); }
0
27. Example
Project: ContinuousTests
Source File: ValueSourceTests.cs
Source File: ValueSourceTests.cs
[Test] public void ValueSourceIsInvokedWithCorrectCurrentDirectory( [ValueSource("CheckCurrentDirectory")] bool isOK) { Assert.That(isOK); }
0
28. Example
Project: ContinuousTests
Source File: TestFixtureAttributeTests.cs
Source File: TestFixtureAttributeTests.cs
[Test] public void ConstructWithoutArguments() { TestFixtureAttribute attr = new TestFixtureAttribute(); Assert.That(attr.Arguments.Length == 0); #if NET_2_0 Assert.That(attr.TypeArgs.Length == 0); #endif }
0
29. Example
Project: ContinuousTests
Source File: NUnitTestFixture.cs
Source File: NUnitTestFixture.cs
[Test] public void test_with_passing_assert() { Assert.That(1 == 1); }
0
30. Example
Project: ContinuousTests
Source File: NUnitTestFixture.cs
Source File: NUnitTestFixture.cs
[Test] public void test_with_failing_assert() { Assert.That(1 == 0); }
0
31. Example
Project: ContinuousTests
Source File: GenericParameterTranslationTests.cs
Source File: GenericParameterTranslationTests.cs
[Test] public void non_generic_parameter_translates_to_itself() { var method = assembly.GetMethodDefinition<ParameterTestMethods>("NonGenericCall"); var result = TypeScanner.ScanMethod(method); var type = result.MemberAccesses[0].ActualMethodDefinition.Parameters[0].GetTypeWithGenericResolve(); Assert.That(type == result.MemberAccesses[0].ActualMethodDefinition.Parameters[0].ParameterType); }
0
32. Example
Project: ContinuousTests
Source File: GenericParameterTranslationTests.cs
Source File: GenericParameterTranslationTests.cs
[Test] public void closed_generic_parameter_translates_to_generic_argument_on_static() { var method = assembly.GetMethodDefinition<ParameterTestMethods>("ClosedStaticGenericCall"); var result = TypeScanner.ScanMethod(method); var type = result.MemberAccesses[0].ActualMethodDefinition.Parameters[0].GetTypeWithGenericResolve(); Assert.That(type.FullName == "System.Int32"); }
0
33. Example
Project: ContinuousTests
Source File: GenericParameterTranslationTests.cs
Source File: GenericParameterTranslationTests.cs
[Test] public void generic_parameter_on_static_method_can_be_translated() { var method = assembly.GetMethodDefinition<ParameterTestMethods>("StaticWithGenericParameter"); var result = TypeScanner.ScanMethod(method); var testReference = (GenericInstanceMethod)result.MemberAccesses[0].ActualMethodDefinition; var type = testReference.Parameters[0].GetTypeWithGenericResolve(testReference); Assert.That(type.FullName == "System.String"); }
0
34. Example
Project: ContinuousTests
Source File: GenericParameterTranslationTests.cs
Source File: GenericParameterTranslationTests.cs
[Test] public void generic_argument_and_generic_parameter_on_static() { var method = assembly.GetMethodDefinition<ParameterTestMethods>("ClosedStaticWithGenericParameter"); var result = TypeScanner.ScanMethod(method); var testReference = (GenericInstanceMethod) result.MemberAccesses[0].ActualMethodDefinition; var type = testReference.Parameters[0].GetTypeWithGenericResolve( testReference); Assert.That(type.FullName == "System.String"); type = testReference.Parameters[1].GetTypeWithGenericResolve(testReference); Assert.That(type.FullName == "System.Int32"); }
0
35. Example
Project: dataexplorer
Source File: DateTimeFilterTreeRootTests.cs
Source File: DateTimeFilterTreeRootTests.cs
[Test] public void TestCreateChildrenShouldCreateNullLeafIfColumnHasNulls() { var column = new ColumnBuilder() .WithValue(DateTime.MinValue) .WithValue(DateTime.MinValue) .WithNulls() .Build(); var root = new DateTimeFilterTreeRoot(string.Empty, column); var result = root.CreateChildren(); Assert.That(result.Single() is NullFilterTreeLeaf); }
0
36. Example
Project: dataexplorer
Source File: DateTimeFilterTreeRootTests.cs
Source File: DateTimeFilterTreeRootTests.cs
[Test] public void TestCreateFilterShouldCreateDateTimeFilterIfColumnDoesNotHasNulls() { var column = new ColumnBuilder() .WithValue(DateTime.MinValue) .WithValue(DateTime.MaxValue) .Build(); var root = new DateTimeFilterTreeRoot(string.Empty, column); var result = root.CreateFilter(); Assert.That(result is DateTimeFilter); }
0
37. Example
Project: dataexplorer
Source File: StringFilterTreeRootTests.cs
Source File: StringFilterTreeRootTests.cs
[Test] public void TestCreateFilterShouldCreateStringFilterIfColumnDoesNotHasNulls() { var column = new ColumnBuilder() .WithValue("test") .Build(); var root = new StringFilterTreeRoot(string.Empty, column); var result = root.CreateFilter(); Assert.That(result is StringFilter); }
0
38. Example
Project: dataexplorer
Source File: FilterTreeFactoryTests.cs
Source File: FilterTreeFactoryTests.cs
[Test] public void TestCreateRootShouldCreateBooleanFilterTreeRoot() { var column = new ColumnBuilder().WithDataType(typeof(Boolean)).Build(); var result = _factory.CreateRoot(column); Assert.That(result is BooleanFilterTreeRoot); }
0
39. Example
Project: dataexplorer
Source File: FilterTreeFactoryTests.cs
Source File: FilterTreeFactoryTests.cs
[Test] public void TestCreateRootShouldCreateDateTimeFilterTreeRoot() { var column = new ColumnBuilder() .WithDataType(typeof(DateTime)) .WithValue(DateTime.MinValue) .Build(); var result = _factory.CreateRoot(column); Assert.That(result is DateTimeFilterTreeRoot); }
0
40. Example
Project: dataexplorer
Source File: FilterTreeFactoryTests.cs
Source File: FilterTreeFactoryTests.cs
[Test] public void TestCreateRootShouldCreateFloatFilterTreeRoot() { var column = new ColumnBuilder() .WithDataType(typeof(Double)) .WithValue(double.MinValue) .Build(); var result = _factory.CreateRoot(column); Assert.That(result is FloatFilterTreeRoot); }
0
41. Example
Project: dataexplorer
Source File: FilterTreeFactoryTests.cs
Source File: FilterTreeFactoryTests.cs
[Test] public void TestCreateRootShouldCreateIntegerFilterTreeRoot() { var column = new ColumnBuilder() .WithDataType(typeof(Int32)) .WithValue(0) .Build(); var result = _factory.CreateRoot(column); Assert.That(result is IntegerFilterTreeRoot); }
0
42. Example
Project: dataexplorer
Source File: FilterTreeFactoryTests.cs
Source File: FilterTreeFactoryTests.cs
[Test] public void TestCreateRootShouldCreateStringFilterTreeRoot() { var column = new ColumnBuilder().WithDataType(typeof(String)).Build(); var result = _factory.CreateRoot(column); Assert.That(result is StringFilterTreeRoot); }
0
43. Example
Project: dataexplorer
Source File: FilterTreeFactoryTests.cs
Source File: FilterTreeFactoryTests.cs
[Test] public void TestCreateRootShouldCreateImageFilterTreeRoot() { var column = new ColumnBuilder() .WithDataType(typeof(BitmapImage)) .Build(); var result = _factory.CreateRoot(column); Assert.That(result is ImageFilterTreeRoot); }
0
44. Example
Project: DotSpatial
Source File: RasterToPolygonTests.cs
Source File: RasterToPolygonTests.cs
[Test] [TestCase(@"Data\DEM_w.tif")] [TestCase(@"Data\DanSite1w.tif")] [TestCase(@"Data\DanSite2w.tif")] [TestCase(@"Data\c1w.tif")] public void CanCreateMultiPartPolygons(string file) { var target = new RasterToPolygon(); var p = new GdalRasterProvider(); var raster = p.Open(file); var outShape = new PolygonShapefile { Filename = FileTools.GetTempFileName(".shp") }; target.Execute(raster, outShape, new MockProgressHandler()); FileTools.DeleteShapeFile(outShape.Filename); var mpCount = outShape.Features.Count(t => t.Geometry is MultiPolygon); Assert.That(mpCount > 0); }
0
45. Example
Project: DotSpatial
Source File: RasterToPolygonTests.cs
Source File: RasterToPolygonTests.cs
[Test] [TestCase(@"Data\DEM_w.tif", @"Data\DEM_p.tif")] [TestCase(@"Data\c1w.tif", @"Data\c1p.tif")] public void NoMultiPartPolygonsWithConnectionGrid(string rasterFile, string flowDirectionGridFile) { var p = new GdalRasterProvider(); var raster = p.Open(rasterFile); var flowDirectionGrid = p.Open(flowDirectionGridFile); var target = new RasterToPolygon(); var outShape = new PolygonShapefile { Filename = FileTools.GetTempFileName(".shp") }; target.Execute(raster, flowDirectionGrid, outShape, new MockProgressHandler()); FileTools.DeleteShapeFile(outShape.Filename); var mpCount = outShape.Features.Count(t => t.Geometry is MultiPolygon); Assert.That(mpCount == 0); }
0
46. Example
Project: mulder
Source File: DictionaryExtensionsTests.cs
Source File: DictionaryExtensionsTests.cs
[Test] public void should_contain_dictionary_items_and_values() { var dictionary = new Dictionary<string, object> { { "item_one", 1 }, { "item_two", "two" } }; dynamic expando = dictionary.ToExpando(); Assert.That(expando.item_one == 1); Assert.That(expando.item_two == "two"); }
0
47. Example
Project: mulder
Source File: DictionaryExtensionsTests.cs
Source File: DictionaryExtensionsTests.cs
[Test] public void should_be_able_to_handle_a_dictionary_as_a_value() { var dictionary = new Dictionary<string, object> { { "item_one", 1 }, { "item_two", "two" }, { "item_three", new Dictionary<string, object> { { "item_one", 1 }, { "item_two", "two" } } } }; dynamic expando = dictionary.ToExpando(); Assert.That(expando.item_one == 1); Assert.That(expando.item_two == "two"); Assert.That(expando.item_three.item_one == 1); Assert.That(expando.item_three.item_two == "two"); }
0
48. Example
Project: mulder
Source File: DictionaryExtensionsTests.cs
Source File: DictionaryExtensionsTests.cs
[Test] public void should_be_able_handle_a_collection_as_a_value() { var dictionary = new Dictionary<string, object> { { "item_one", new List<string> { "one", "two", "three" } } }; dynamic expando = dictionary.ToExpando(); Assert.That(expando.item_one.Contains("one")); Assert.That(expando.item_one.Contains("two")); Assert.That(expando.item_one.Contains("three")); }
0
49. Example
Project: libphonenumber-csharp
Source File: TestPhoneNumberUtil.cs
Source File: TestPhoneNumberUtil.cs
[Test] public void TestGetSupportedRegions() { Assert.That(phoneUtil.GetSupportedRegions().Count > 0); }
0
50. Example
Project: fluentmigrator
Source File: MigratorConsoleTests.cs
Source File: MigratorConsoleTests.cs
[Test] public void MustInitializeConsoleWithConnectionArgument() { new MigratorConsole("/db", Database); Assert.That(Environment.ExitCode == 1); }