NUnit.Framework.Assert.IsTrue(bool)

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

200 Examples 7

1. Example

Project: BloomDesktop
Source File: BookTests.cs
View license
[Test]
		public void GetPreviewHtmlFileForWholeBook_what_UsesPreviewCss()
		{
			Assert.IsTrue(CreateBook().GetPreviewHtmlFileForWholeBook().InnerXml.Contains("previewMode.css"));
		}

2. Example

View license
[Test]
		public void ShouldNormallyShowEditable_SituationsWhereNationalLanguagesShouldBeShown()
		{
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("fr", new[] { "V","N1" }, "", "", _collectionSettings.Object),
				"The data-default-languages calls for the vernacular and n1");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("fr", new[] { "N1" }, "", "", _collectionSettings.Object),
				"The data-default-languages calls for the n1; it should show.");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("fr", new[] { "N1","N2" }, "", "", _collectionSettings.Object),
				"The data-default-languages calls for both national languages");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("es", new[] { "N1", "N2" }, "", "", _collectionSettings.Object),
				"The data-default-languages calls for both national languages");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("fr", new[] { "auto" }, "fr", "es", _collectionSettings.Object),
				"Auto and Trilingual, so should show all three languages.");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("es", new[] { "auto" }, "fr", "es", _collectionSettings.Object),
				"Auto and Trilingual, so should show all three languages.");
		}

3. Example

Project: BloomDesktop
Source File: BookTests.cs
View license
[Test]
		public void CanDelete_VernacularBook_True()
		{
			var book = CreateBook();
			Assert.IsTrue(book.CanDelete);
		}

4. Example

View license
[Test]
		public void ShouldNormallyShowEditable_SituationsWhereNumberedLanguagesShouldBeShown()
		{
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("xyz", new[] { "L1" }, "", "", _collectionSettings.Object),
				"The data-default-languages calls for the L1");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("fr", new[] { "L2" }, "", "", _collectionSettings.Object),
				"The data-default-languages calls for the L2.");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("es", new[] { "L3"}, "", "", _collectionSettings.Object),
				"The data-default-languages calls for the L3.");
		}

5. Example

View license
[Test]
		public void ServerAddressIsBogus_ErrorIsCorrect()
		{
			var t = new UpdateVersionTable {URLOfTable = "http://notthere7blah/foo.txt"};
			//the jenkins server gets a ProtocolError, while my desktop gets a NameResolutionFailure
			var e = t.LookupURLOfUpdate().Error.Status;
			//This test can fail if the ISP "helpfully" returns a custom advertising filled access failure page.
			Assert.IsTrue(e  == WebExceptionStatus.NameResolutionFailure || e == WebExceptionStatus.ProtocolError );
		}

6. Example

Project: BloomDesktop
Source File: BookDataTests.cs
View license
[Test]
		public void StringAlternativeHasNoText_NewLines()
		{
			Assert.IsTrue(BookData.StringAlternativeHasNoText(NewLines));
		}

7. Example

View license
[Test]
		public void ShouldNormallyShowEditable_SituationsWhereVernacularShouldBeShown()
		{
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("xyz", new[] {"V"}, "", "", _collectionSettings.Object),
				"The data-default-languages calls for the vernacular ");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("xyz", new[] { "N1","V" }, "", "", _collectionSettings.Object),
				"The data-default-languages calls for the vernacular ");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("xyz", new string[] {}, "", "", _collectionSettings.Object),
				"The data-default-languages is empty, so should default to 'auto', which always includes vernacular ");

			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("xyz", new[] { "" }, "", "", _collectionSettings.Object),
				"The data-default-languages is empty, so should default to 'auto', which always includes vernacular ");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("xyz", new[] { "auto" }, "", "", _collectionSettings.Object),
				"The data-default-languages is auto, which always includes vernacular ");
			Assert.IsTrue(TranslationGroupManager.ShouldNormallyShowEditable("xyz", new[] { "AUTO" }, "", "", _collectionSettings.Object),
				"The data-default-languages is AUTO, which always includes vernacular ");
		}

8. Example

View license
private void Login()
		{
			// This line can be uncommented for a single run of one test as an easy way to re-create the record that we assume
			// always exists on parse.com.
			//_client.CreateUser("[email protected]", "unittest");
			Assert.IsTrue(_client.LogIn("[email protected]", "unittest"),
				"Could not log in using the [email protected] account");
		}

9. Example

View license
[Test]
		public void GetLocalizableFileDistributedWithApplication_CurrentlyInEnglish_FindsIt()
		{
			var path = BloomFileLocator.GetBestLocalizableFileDistributedWithApplication(false, "infoPages", "TrainingVideos-en.htm");
			Assert.IsTrue(path.EndsWith("TrainingVideos-en.htm"));
		}

10. Example

Project: BloomDesktop
Source File: HtmlHandlerTests.cs
View license
[Test]
		public void CanMergeFile_HTM_True()
		{
			var h = new BloomHtmlFileTypeHandler();

			using (var f = TempFile.WithExtension(".htm"))
			{
				Assert.IsTrue(h.CanMergeFile(f.Path));
			}
		}

11. Example

Project: BloomDesktop
Source File: UrlPathStringTests.cs
View license
[Test]
		public void EqualityOperator_AreEqual_True()
		{
			Assert.IsTrue(UrlPathString.CreateFromUrlEncodedString("test me") == UrlPathString.CreateFromUrlEncodedString("test "+"me"));
		}

12. Example

View license
[Test]
		public void GetBestLocalizedFile_HaveFrench_FindsIt()
		{
			LocalizationManager.SetUILanguage("fr", false);
			var englishPath = BloomFileLocator.DirectoryOfTheApplicationExecutable.CombineForPath(
				"../browser/templates/xMatter/Traditional-XMatter/description-en.txt");
			var bestLocalizedFile = BloomFileLocator.GetBestLocalizedFile(englishPath);
			Assert.IsTrue(bestLocalizedFile.Contains("-fr"));
		}

13. Example

Project: BloomDesktop
Source File: UrlPathStringTests.cs
View license
[Test]
		public void Equals_AreEqual_True()
		{
			Assert.IsTrue(UrlPathString.CreateFromUrlEncodedString("test me").Equals(UrlPathString.CreateFromUrlEncodedString("test " + "me")));
		}

14. Example

Project: nini
Source File: AliasTextTests.cs
View license
[Test]
        [ExpectedException (typeof (ArgumentException))]
        public void NonExistantBooleanText ()
        {
            AliasText alias = new AliasText ();
            alias.AddAlias ("true", true);
            alias.AddAlias ("faLSe", false);
            
            Assert.IsTrue (alias.GetBoolean ("Not present"));
        }

15. Example

View license
[Test]
        public void AppendFileTest()
        {
            foreach(var d in Directories)
                Assert.IsTrue(d.AppendFile("file").IsFile);
            foreach (var d in Directories)
                Assert.IsTrue(d.AppendFile("file").EntityName == "file");
            foreach(var d in Directories)
                Assert.IsTrue(d.AppendFile("file").ParentPath == d);
            EAssert.Throws<InvalidOperationException>(() => fileA.AppendFile("file"));
            EAssert.Throws<ArgumentException>(() => directoryA.AppendFile("dir/file"));
        }

16. Example

View license
[Test]
        public void AppendDirectoryTest()
        {
            foreach(var d in Directories)
                Assert.IsTrue(d.AppendDirectory("dir").IsDirectory);
            foreach(var d in Directories)
                Assert.IsTrue(d.AppendDirectory("dir").EntityName == "dir");
            foreach (var d in Directories)
                Assert.IsTrue(d.AppendDirectory("dir").ParentPath == d);
            EAssert.Throws<InvalidOperationException>(() => fileA.AppendDirectory("dir"));
            EAssert.Throws<ArgumentException>(() => root.AppendDirectory("dir/dir"));
        }

17. Example

Project: boo
Source File: EnumMemberTest.cs
View license
[Test]
		public void EnumMemberIsStatic()
		{
			Assert.IsTrue(new EnumMember().IsStatic);
		}

18. Example

Project: boo
Source File: NodeMatchingTest.cs
View license
[Test]
		public void GenericTypeReferenceMatchesGenericTypeReferenceWithSamePrefix()
		{
			Assert.IsTrue(new GenericTypeReference("Foo").Matches(new GenericTypeReference("Foo")));
		}

19. Example

Project: Cropper
Source File: JpgFormatTests.cs
View license
[Test]
        public void HostInOptions_is_true()
        {
            JpgFormat format = new JpgFormat();

            Assert.IsTrue(format.HostInOptions);
        }

20. Example

Project: Cropper
Source File: ClipboardFormatTests.cs
View license
[Test]
        public void HostInOptions_is_true()
        {
            ClipboardFormat format = new ClipboardFormat();

            Assert.IsTrue(format.HostInOptions);
        }

21. Example

Project: Cropper
Source File: CropSizeTests.cs
View license
[Test]
        public void Two_CropSize_are_equal_if_Width_and_Height_match()
        {
            int width = 119;
            int height = 104;

            CropSize left = new CropSize(width, height);
            CropSize right = new CropSize(width, height);

            Assert.IsTrue(left.Equals(right));
            Assert.IsTrue(left.Equals((object) right));
        }

22. Example

Project: BrightstarDB
Source File: TestHelper.cs
View license
public static void AssertJobCompletesSuccessfully(IBrightstarService client, string storeName, IJobInfo job)
        {
            while (!job.JobCompletedOk && !job.JobCompletedWithErrors)
            {
                Task.Delay(10).Wait();
                job = client.GetJobInfo(storeName, job.JobId);
            }
            Assert.IsTrue(job.JobCompletedOk, "Expected job to complete successfully, but it failed with message '{0}' : {1}", job.StatusMessage, job.ExceptionInfo);
        }

23. Example

Project: BrightstarDB
Source File: StoreTests.cs
View license
private void AssertJobSuccessful(IBrightstarService client, string storeName, IJobInfo job)
        {
            while (!(job.JobCompletedOk || job.JobCompletedWithErrors))
            {
                Task.Delay(3).Wait();
                job = client.GetJobInfo(storeName, job.JobId);
            }
            Assert.IsTrue(job.JobCompletedOk, "Job failed with message: {0} : {1}", job.StatusMessage, job.ExceptionInfo);
        }

24. Example

Project: BrightstarDB
Source File: ManifestSyntax.cs
View license
private static void CompareTripleCollections(BaseTripleCollection actualTriples, BaseTripleCollection expectedTriples, bool reduced) 
		{
            var alreadySeen = new HashSet<Triple>();
            foreach (var expectedTriple in expectedTriples)
            {
                if (reduced && alreadySeen.Contains(expectedTriple)) continue;
                Assert.IsTrue(actualTriples.Contains(expectedTriple),
                              "Could not find expected triple '{0}' in results set.", expectedTriple);
            }
            foreach(var actualTriple in actualTriples)
            {
                Assert.IsTrue(expectedTriples.Contains(actualTriple),
                    "Unexpected result set triple '{0}'", actualTriple);
            }
		}

25. Example

Project: BrightstarDB
Source File: StoreTests.cs
View license
private void AssertJobSuccessful(IBrightstarService client,string storeName, IJobInfo job)
		{
			while (!(job.JobCompletedOk || job.JobCompletedWithErrors))
			{
				Task.Delay(3).Wait();
				job = client.GetJobInfo(storeName, job.JobId);
			}
			Assert.IsTrue(job.JobCompletedOk, "Job failed with message: {0} : {1}", job.StatusMessage, job.ExceptionInfo);
		}

26. Example

Project: BrightstarDB
Source File: StoreTests.cs
View license
private void AssertJobSuccessful(IBrightstarService client, string storeName, IJobInfo job)
        {
            while (!(job.JobCompletedOk || job.JobCompletedWithErrors))
            {
                Task.Delay(3).Wait();
                job = client.GetJobInfo(storeName, job.JobId);
            }
            Assert.IsTrue(job.JobCompletedOk, "Job failed with message: {0} : {1}", job.StatusMessage, job.ExceptionInfo);
        }

27. Example

Project: tsql-parser
Source File: TokenEqualityTests.cs
View license
[Test]
		public void TokenEquality_SameToken()
		{
			TSQLKeyword token = new TSQLKeyword(0, "GO");
			Assert.IsTrue(token.Equals(token));
		}

28. Example

Project: tsql-parser
Source File: TokenEqualityTests.cs
View license
[Test]
		public void TokenEquality_SameValue()
		{
			TSQLKeyword token1 = new TSQLKeyword(0, "GO");
			TSQLKeyword token2 = new TSQLKeyword(0, "GO");
			Assert.IsTrue(token1.Equals(token2));
		}

29. Example

Project: tsql-parser
Source File: TokenEqualityTests.cs
View license
[Test]
		public void TokenEquality_NotEqualOperatorNull()
		{
			TSQLKeyword token = new TSQLKeyword(0, "GO");
			Assert.IsTrue(null != token);
		}

30. Example

Project: tsql-parser
Source File: TokenEqualityTests.cs
View license
[Test]
		public void TokenEquality_NotEqualOperator()
		{
			TSQLKeyword token1 = new TSQLKeyword(0, "GO");
			TSQLKeyword token2 = new TSQLKeyword(0, "USE");
			Assert.IsTrue(token1 != token2);
		}

31. Example

Project: tsql-parser
Source File: TokenEqualityTests.cs
View license
[Test]
		public void TokenEquality_EqualsOperator()
		{
			TSQLKeyword token1 = new TSQLKeyword(0, "GO");
			TSQLKeyword token2 = new TSQLKeyword(0, "GO");
			Assert.IsTrue(token1 == token2);
		}

32. Example

Project: tsql-parser
Source File: TokenEqualityTests.cs
View license
[Test]
		public void TokenEquality_SameValueAsObject()
		{
			TSQLKeyword token1 = new TSQLKeyword(0, "GO");
			Object token2 = new TSQLKeyword(0, "GO");
			Assert.IsTrue(token1.Equals(token2));
		}

33. Example

View license
[Test]
        public void ShouldKnowWhenValidEncoding()
        {
            Assert.IsTrue(new OutputFileEncoding("iso-8859-1").IsValid());
        }

34. Example

Project: dbdeploy.net
Source File: ChangeScriptTest.cs
View license
[Test]
        public void TestChangeScriptsNaturallyOrderById()
        {
            ChangeScript one = new ChangeScript("v1.0", 1);
            ChangeScript two = new ChangeScript("v1.0", 2);
            Assert.IsTrue(one.CompareTo(two) < 1);
            Assert.IsTrue(two.CompareTo(one) >= 1);
        }

35. Example

Project: AutoTest.Net
Source File: ProjectConfigTests.cs
View license
[Test]
        public void SettingInactiveConfigConfigurationFileMarksProjectDirty()
        {
            inactiveConfig.ConfigurationFile = "MyProject.config";
            Assert.IsTrue(project.IsDirty);
        }

36. Example

Project: AutoTest.Net
Source File: PathUtilTests.cs
View license
public static void SamePathOrUnder( string path1, string path2 )
		{
			string msg = "\r\n\texpected: Same path or under <{0}>\r\n\t but was: <{1}>";
			Assert.IsTrue( PathUtils.SamePathOrUnder( path1, path2 ), msg, path1, path2 );
		}

37. Example

View license
[Test]
		public void FixtureValidate()
		{
			Assert.IsTrue(fixtureOptions.Validate());
		}

38. Example

View license
[Test]
        public void MultipleNameMatch()
        {
            Test mock1 = TestFinder.Find("MockTest1", testSuite, true);
            SimpleNameFilter filter = new SimpleNameFilter();
            filter.Add("NUnit.Tests.Assemblies.MockTestFixture.MockTest3");
            filter.Add("NUnit.Tests.Assemblies.MockTestFixture.MockTest1");
            Assert.IsTrue(filter.Pass(mock3), "Name Filter did not pass test case");
            Assert.IsTrue(filter.Pass(mock1), "Name Filter did not pass test case");
            Assert.IsTrue(filter.Pass((TestSuite)testSuite.Tests[0]), "Name Filter did not pass test suite");
        }

39. Example

View license
[Test]
        public void SettingActiveConfigFiresChangedEvent()
        {
            doc.LoadXml(NUnitProjectXml.NormalProject);
            project.ActiveConfigName = "Release";
            Assert.IsTrue(gotChangeNotice);
        }

40. Example

Project: AutoTest.Net
Source File: PathUtilTests.cs
View license
public static void SamePath( string path1, string path2 )
		{
			string msg = "\r\n\texpected: Same path as <{0}>\r\n\t but was: <{1}>";
			Assert.IsTrue( PathUtils.SamePath( path1, path2 ), msg, path1, path2 );
		}

41. Example

Project: AutoTest.Net
Source File: SetUpTest.cs
View license
[Test]
        public void BaseSetUpIsCalledFirstTearDownLast()
        {
            DerivedClassWithSeparateSetUp fixture = new DerivedClassWithSeparateSetUp();
            TestBuilder.RunTestFixture(fixture);

            Assert.IsTrue(fixture.wasSetUpCalled, "Base SetUp Called");
            Assert.IsTrue(fixture.wasTearDownCalled, "Base TearDown Called");
            Assert.IsTrue(fixture.wasDerivedSetUpCalled, "Derived SetUp Called");
            Assert.IsTrue(fixture.wasDerivedTearDownCalled, "Derived TearDown Called");
            Assert.IsTrue(fixture.wasBaseSetUpCalledFirst, "SetUp Order");
            Assert.IsTrue(fixture.wasBaseTearDownCalledLast, "TearDown Order");
        }

42. Example

View license
[Test, Repeat(3)]
		public void RepeatSuccess()
		{
			count++;
			Assert.IsTrue (true);
		}

43. Example

Project: AutoTest.Net
Source File: ProjectConfigTests.cs
View license
[Test]
        public void RenameActiveConfigRequiresReload()
        {
            activeConfig.Name = "Renamed";
            Assert.IsTrue(project.HasChangesRequiringReload);
        }

44. Example

View license
[Test]
		public void FixtureValidate()
		{
			Assert.IsTrue(fixtureOptions.Validate());
		}

45. Example

Project: AutoTest.Net
Source File: NUnitProjectTests.cs
View license
[Test]
		public void RenameConfigMakesProjectDirty()
		{
			project.Configs.Add("Old");
			project.IsDirty = false;
			project.Configs[0].Name = "New";
			Assert.IsTrue( project.IsDirty );
		}

46. Example

Project: AutoTest.Net
Source File: CommandLineTests.cs
View license
[Test]
		public void Help()
		{
			GuiOptions options = new GuiOptions(new string[] {"-help"});
			Assert.IsTrue(options.help);
		}

47. Example

View license
[Test]
		public void MultipleAssemblyValidate()
		{
			Assert.IsTrue(assemblyOptions.Validate());
		}

48. Example

Project: AutoTest.Net
Source File: NameFilterTest.cs
View license
[Test]
		public void MultipleNameMatch() 
		{
			Test mock1 = TestFinder.Find("MockTest1", testSuite, true);
			NameFilter filter = new NameFilter();
			filter.Add(mock3.TestName);
			filter.Add(mock1.TestName);
			Assert.IsTrue(filter.Pass(mock3), "Name Filter did not pass test case");
			Assert.IsTrue(filter.Pass(mock1), "Name Filter did not pass test case");
			Assert.IsTrue(filter.Pass((TestSuite)testSuite.Tests[0]), "Name Filter did not pass test suite");
		}

49. Example

Project: AutoTest.Net
Source File: AssemblyReaderTests.cs
View license
[Test]
		public void IsValidPeFile()
		{
			Assert.IsTrue( rdr.IsValidPeFile );
		}

50. Example

Project: AutoTest.Net
Source File: ProjectConfigTests.cs
View license
[Test]
        public void SettingActiveConfigBinPathTypeRequiresReload()
        {
            activeConfig.BinPathType = BinPathType.Manual;
            Assert.IsTrue(project.HasChangesRequiringReload);
        }