NUnit.Framework.Assert.That(bool)

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 7

151. Example

Project: ContinuousTests
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);
        }

152. Example

Project: ContinuousTests
Source File: ParameterizedTestFixtureTests.cs
[Test]
        public void CanAccessValueSource(
            [ValueSource("intvals")] int x)
        {
            Assert.That(answer % x == 0);
        }

153. Example

Project: ContinuousTests
Source File: TestCaseSourceTests.cs
[Test, TestCaseSource("CheckCurrentDirectory")]
        public void SourceIsInvokedWithCorrectCurrentDirectory(bool isOK)
        {
            Assert.That(isOK);
        }

154. Example

Project: ContinuousTests
Source File: ValueSourceTests.cs
[Test]
        public void ValueSourceIsInvokedWithCorrectCurrentDirectory(
            [ValueSource("CheckCurrentDirectory")] bool isOK)
        {
            Assert.That(isOK);
        }

155. Example

Project: ContinuousTests
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
        }

156. Example

Project: ContinuousTests
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);
        }

157. Example

Project: ContinuousTests
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);
        }

158. Example

Project: ContinuousTests
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);
        }

159. Example

Project: ContinuousTests
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);
        }

160. Example

Project: ContinuousTests
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);
        }

161. Example

Project: ContinuousTests
Source File: ParameterizedTestFixtureTests.cs
[Test]
        public void CanAccessValueSource(
            [ValueSource("intvals")] int x)
        {
            Assert.That(answer % x == 0);
        }

162. Example

Project: ContinuousTests
Source File: TestCaseSourceTests.cs
[Test, TestCaseSource("CheckCurrentDirectory")]
        public void SourceIsInvokedWithCorrectCurrentDirectory(bool isOK)
        {
            Assert.That(isOK);
        }

163. Example

Project: ContinuousTests
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);
        }

164. Example

Project: ContinuousTests
Source File: ValueSourceTests.cs
[Test]
        public void ValueSourceIsInvokedWithCorrectCurrentDirectory(
            [ValueSource("CheckCurrentDirectory")] bool isOK)
        {
            Assert.That(isOK);
        }

165. Example

Project: ContinuousTests
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
        }

166. Example

Project: ContinuousTests
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);
        }

167. Example

Project: ContinuousTests
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);
        }

168. Example

Project: ContinuousTests
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);
        }

169. Example

Project: ContinuousTests
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);
        }

170. Example

Project: ContinuousTests
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);
        }

171. Example

Project: ContinuousTests
Source File: ParameterizedTestFixtureTests.cs
[Test]
        public void CanAccessValueSource(
            [ValueSource("intvals")] int x)
        {
            Assert.That(answer % x == 0);
        }

172. Example

Project: ContinuousTests
Source File: TestCaseSourceTests.cs
[Test, TestCaseSource("CheckCurrentDirectory")]
        public void SourceIsInvokedWithCorrectCurrentDirectory(bool isOK)
        {
            Assert.That(isOK);
        }

173. Example

Project: ContinuousTests
Source File: ValueSourceTests.cs
[Test]
        public void ValueSourceIsInvokedWithCorrectCurrentDirectory(
            [ValueSource("CheckCurrentDirectory")] bool isOK)
        {
            Assert.That(isOK);
        }

174. Example

Project: ContinuousTests
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
        }

175. Example

Project: ContinuousTests
Source File: NUnitTestFixture.cs
[Test]
        public void test_with_passing_assert()
        {
            Assert.That(1 == 1);
        }

176. Example

Project: ContinuousTests
Source File: NUnitTestFixture.cs
[Test]
        public void test_with_failing_assert()
        {
            Assert.That(1 == 0);
        }

177. Example

Project: ContinuousTests
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);
        }

178. Example

Project: ContinuousTests
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");
        }

179. Example

Project: ContinuousTests
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");               
        }

180. Example

Project: ContinuousTests
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");
        }

181. Example

Project: dataexplorer
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);
        }

182. Example

Project: dataexplorer
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);
        }

183. Example

Project: dataexplorer
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);
        }

184. Example

Project: dataexplorer
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);
        }

185. Example

Project: dataexplorer
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);
        }

186. Example

Project: dataexplorer
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);
        }

187. Example

Project: dataexplorer
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);
        }

188. Example

Project: dataexplorer
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);
        }

189. Example

Project: dataexplorer
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);
        }

190. Example

Project: DotSpatial
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);
        }

191. Example

Project: DotSpatial
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);
        }

192. Example

Project: mulder
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");
			}

193. Example

Project: mulder
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");
			}

194. Example

Project: mulder
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"));
			}

195. Example

Project: libphonenumber-csharp
Source File: TestPhoneNumberUtil.cs
[Test]
        public void TestGetSupportedRegions()
        {
            Assert.That(phoneUtil.GetSupportedRegions().Count > 0);
        }

196. Example

Project: fluentmigrator
Source File: MigratorConsoleTests.cs
[Test]
        public void MustInitializeConsoleWithConnectionArgument()
        {
            new MigratorConsole("/db", Database);
            Assert.That(Environment.ExitCode == 1);
        }

197. Example

Project: fluentmigrator
Source File: MigratorConsoleTests.cs
[Test]
        public void MustInitializeConsoleWithDatabaseArgument()
        {
            new MigratorConsole("/connection", Connection);
            Assert.That(Environment.ExitCode == 1);
        }

198. Example

Project: FAtiMA-Toolkit
Source File: NameSearchTreeTests.cs
[Test]
        public void Depth_EmptyNameSearchTree_0()
        {
            var tree = new NameSearchTree<string>();
            Assert.That(tree.Depth == 0);
        }

199. Example

Project: FAtiMA-Toolkit
Source File: NameTests.cs
[TestCase("[y]")]
        [TestCase("[x]")]
        [TestCase("IsPerson(x)")]
        [TestCase("Likes(x, y)")]
        [TestCase("Likes([x], y)")]
        [TestCase("Likes(x, Likes(x, x))")]
        [TestCase("Likes(x, Likes(y, Hates([y], x)))")]
        [TestCase("[x]([x], y, z)")]
        public void ExplicitCastName_CorrectNameString_NewName(string nameString)
        {
            var name = (Name)nameString;
            Assert.That(name.ToString() == nameString);
        }

200. Example

Project: FAtiMA-Toolkit
Source File: SubstitutionTests.cs
[TestCase("[x]/John", "[x]", "John")]
		[TestCase("[x]/IsPerson(John)", "[x]", "IsPerson(John)")]
		public void Substitution_ValidSubstitutionString_NewSubstitution(string s, string var, string val)
		{
			var sub = new Substitution(s);
			Assert.That(sub.Variable.ToString() == var);
			Assert.That(sub.SubValue.Value.ToString() == val);
		}