NUnit.Framework.Assert.IsFalse(bool, string)

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

200 Examples 7

1. Example

Project: ContinuousTests
Source File: MockTestRunner.cs
View license
public override void Verify()
		{
			base.Verify();

			if ( LastException != null )
				throw LastException;

			if ( runnerThread != null )
				Assert.IsFalse( Thread.CurrentThread == runnerThread, "Run should execute on a different thread" );
		}

2. Example

Project: ContinuousTests
Source File: MockTestRunner.cs
View license
public override void Verify()
		{
			base.Verify();

			if ( LastException != null )
				throw LastException;

			if ( runnerThread != null )
				Assert.IsFalse( Thread.CurrentThread == runnerThread, "Run should execute on a different thread" );
		}

3. Example

Project: CLAP
Source File: MultiParserTests.cs
View license
[Test, ExpectedException(typeof(DuplicateTargetAliasException))]
        public void MultiParser_Run_With_Target_Alias_That_Is_Defined_More_Than_Once()
        {
            var mock = new MethodInvokerMock();

            var called = false;

            mock.Action = (method, obj, parameters) =>
            {
                called = true;
            };

            MethodInvoker.Invoker = mock;

            var p = new Parser(typeof(Sample_02), typeof(Sample_02_Default));

            p.RunTargets(new[]
            {
                "s02.print", //both of the provided types below have the same alias attribute value.
                "-c=10",
                "-prefix=aaa",
            }, new Sample_02(), new Sample_02_Default());

            Assert.IsFalse(called, "The method should not have been called due to the conflicting aliases.");
        }

4. Example

View license
[Test]
		public void DefaultValues ()
		{
			var s = new XamlSchemaContextSettings ();
			Assert.IsFalse (s.FullyQualifyAssemblyNamesInClrNamespaces, "#1");
			Assert.IsFalse (s.SupportMarkupExtensionsWithDuplicateArity, "#2");
		}

5. Example

View license
[Test]
		public void DefaultValues ()
		{
			var s = new XamlXmlWriterSettings ();
			Assert.IsFalse (s.AssumeValidInput, "#1");
			Assert.IsFalse (s.CloseOutput, "#2");
		}

6. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsInt_list_evaluates_false()
        {
            var systemUnderTest = new ValueObject(new ArrayList());
            Assert.IsFalse(systemUnderTest.IsInt, "IsInt should evaluate to false when ValueObject wraps a list.");
        }

7. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsString_list_evalutes_false()
        {
            var systemUnderTest = new ValueObject(new ArrayList());
            Assert.IsFalse(systemUnderTest.IsString, "IsString should evaluate to false when ValueObject wraps a list.");
        }

8. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsNullOrEmpty_nonempty_string_evaluates_false()
        {
            var systemUnderTest = new ValueObject("a");
            Assert.IsFalse(systemUnderTest.IsNullOrEmpty, "IsNullOrEmpty should evaluate to false when ValueObject wraps a non-empty string.");
        }

9. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsFalse_number_evaluates_false()
        {
            var systemUnderTest = new ValueObject(0);
            Assert.IsFalse(systemUnderTest.IsFalse, "IsFalse should evaluate to false when ValueObject wraps an integer.");
        }

10. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsFalse_null_evaluates_false()
        {
            var systemUnderTest = new ValueObject(null);
            Assert.IsFalse(systemUnderTest.IsFalse, "IsFalse should evaluate to false when ValueObject wraps null.");
        }

11. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsNullOrEmpty_number_evaluates_false()
        {
            var systemUnderTest = new ValueObject(1);
            Assert.IsFalse(systemUnderTest.IsNullOrEmpty, "IsNullOrEmpty should evaluate to false when ValueObject wraps an integer.");
        }

12. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsInt_noninteger_string_evaluates_false()
        {
            var systemUnderTest = new ValueObject("3.14");
            Assert.IsFalse(systemUnderTest.IsInt, "IsInt should evaluate to false when ValueObject wraps a string that cannot be converted to an integer.");
            systemUnderTest = new ValueObject("abcde");
            Assert.IsFalse(systemUnderTest.IsInt, "IsInt should evaluate to false when ValueObject wraps a string that cannot be converted to an integer.");
        }

13. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsNullOrEmpty_bool_evaluates_false()
        {
            var systemUnderTest = new ValueObject(true);
            Assert.IsFalse(systemUnderTest.IsNullOrEmpty, "IsNullOrEmpty should evaluate to false when ValueObject wraps a bool.");
            systemUnderTest = new ValueObject(false);
            Assert.IsFalse(systemUnderTest.IsNullOrEmpty, "IsNullOrEmpty should evaluate to false when ValueObject wraps a bool.");
        }

14. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsTrue_number_evaluates_false()
        {
            var systemUnderTest = new ValueObject(1);
            Assert.IsFalse(systemUnderTest.IsTrue, "IsTrue should evaluate to false when ValueObject wraps an integer.");
        }

15. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsString_null_evalutes_false()
        {
            var systemUnderTest = new ValueObject(null);
            Assert.IsFalse(systemUnderTest.IsString, "IsString should evaluate to false when ValueObject wraps null.");
        }

16. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsTrue_null_evaluates_false()
        {
            var systemUnderTest = new ValueObject(null);
            Assert.IsFalse(systemUnderTest.IsTrue, "IsTrue should evaluate to false when ValueObject wraps null.");
        }

17. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsTrue_string_evaluates_false()
        {
            var systemUnderTest = new ValueObject("true");
            Assert.IsFalse(systemUnderTest.IsTrue, "IsTrue should evaluate to false when ValueObject wraps a string.");
        }

18. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsNullOrEmpty_list_evaluates_false()
        {
            var systemUnderTest = new ValueObject(new ArrayList());
            Assert.IsFalse(systemUnderTest.IsNullOrEmpty, "IsNullOrEmpty should evaluate to false when ValueObject wraps a list.");
        }

19. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsFalse_string_evaluates_false()
        {
            var systemUnderTest = new ValueObject("false");
            Assert.IsFalse(systemUnderTest.IsFalse, "IsFalse should evaluate to false when ValueObject wraps a string.");
        }

20. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsInt_null_evaluates_false()
        {
            var systemUnderTest = new ValueObject(null);
            Assert.IsFalse(systemUnderTest.IsInt, "IsInt should evaluate to false when ValueObject wraps null.");
        }

21. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsTrue_false_evaluates_false()
        {
            var systemUnderTest = new ValueObject(new ArrayList());
            Assert.IsFalse(systemUnderTest.IsTrue, "IsTrue should evaluate to false when ValueObject wraps false.");
        }

22. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsList_string_evaluates_false()
        {
            var systemUnderTest = new ValueObject("1,2,3,4,5");
            Assert.IsFalse(systemUnderTest.IsList, "IsList should evaluate to false when ValueObject wraps a string.");
        }

23. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsFalse_true_evaluates_false()
        {
            var systemUnderTest = new ValueObject(new ArrayList());
            Assert.IsFalse(systemUnderTest.IsFalse, "IsFalse should evaluate to false when ValueObject wraps true.");
        }

24. Example

Project: NPOI
Source File: TestBiff8DecryptingStream.cs
View license
public void AssertNoErrors()
            {
                Assert.IsFalse(_errorsOccurred, "Some values decrypted incorrectly");
            }

25. Example

View license
public static void ShouldBeFalse(this bool source, string message)
        {
            Assert.IsFalse(source, message);
        }

26. Example

View license
public static void ShouldBeFalse(this bool source, string message)
        {
            Assert.IsFalse(source, message);
        }

27. Example

View license
public static void ShouldBeFalse(this bool condition, string message)
        {
            Assert.IsFalse(condition, message);
        }

28. Example

View license
[Test]
		public void VBNetInvalidOptionDeclarationTest()
		{
			string program = "Option\n";
			IParser parser = ParserFactory.CreateParser(SupportedLanguage.VBNet, new StringReader(program));
			parser.Parse();
			Assert.IsFalse(parser.Errors.ErrorOutput.Length == 0, "Expected errors, but operation completed successfully");
		}

29. Example

Project: linq2db
Source File: OrderByTests.cs
View license
[Test, DataContextSource(false)]
		public void OrderBy6(string context)
		{
			using (var db = (TestDataConnection)GetDataContext(context))
			{
				var q =
					from person in db.Person
					join patient in db.Patient on person.ID equals patient.PersonID into g
					from patient in g.DefaultIfEmpty()
					orderby person.MiddleName // if comment this line then "Diagnosis" is not selected.
					select new { person.ID, PatientID = patient != null ? (int?)patient.PersonID : null };

				q.ToList();

				Assert.IsFalse(db.LastQuery.Contains("Diagnosis"), "Why do we select Patient.Diagnosis??");
			}
		}

30. Example

Project: msbuildtasks
Source File: AddTnsNameTest.cs
View license
[Test]
        public void The_task_should_fail_when_no_TnsNamesFile_can_be_found()
        {
            using (mocks.Record())
            {
                SetupResult.For(registry.GetSubKeys(RegistryHive.LocalMachine, @"SOFTWARE\ORACLE")).Return(new string[0]);
            }
            bool success = task.Execute();
            Assert.IsFalse(success, "Task should have failed when no file could be found.");
        }

31. Example

Project: DReAM
Source File: XDoc-Test.cs
View license
[Test]
        public void VisitAllMakesReturnedNodesRoot_without_nested_image() {
            var doc = new XDoc("html")
                .Start("body")
                    .Start("div")
                        .Start("a").Attr("href", "http://dummy/a/b/c")
                            .Value("hello world")
                        .End()
                    .End()
                    .Start("img").Attr("src", "http://dummy/123.png").End()
                .End();
            bool foundImage = false;
            foreach(var item in doc.VisitAll().Where(node => node.HasName("a"))) {
                foundImage = foundImage || !item[".//img"].IsEmpty;
            }
            Assert.IsFalse(foundImage, "<img> should NOT have been found");
        }

32. Example

Project: xwt
Source File: WindowTests.cs
View license
[Test]
		public void CloseCancel ()
		{
			bool closed = false;
			using (var win = new Window ()) {
				ShowWindow (win);
				win.CloseRequested += delegate(object sender, CloseRequestedEventArgs args) {
					args.AllowClose = false;
				};
				win.Closed += (sender, e) => closed = true;
				win.Close ();
				Assert.IsFalse (closed, "Window should not be closed");
			}
			Assert.IsFalse (closed, "Window should not be closed");
		}

33. Example

Project: hbm-to-fnh
Source File: AssertExtensions.cs
View license
public static void ShouldBeFalse(this bool item, [NotNull] string errorMessage)
		{
			Assert.IsFalse(item, errorMessage);
		}

34. Example

Project: n2cms
Source File: SecurityManagerTests.cs
View license
[Test]
        public void UnpublishedIsNotPublished()
        {
            mocks.ReplayAll();

            ContentItem root = CreateOneItem<Items.SecurityPage>(1, "root", null);
            root.Published = null;

            bool isPublished = security.IsPublished(root);
            Assert.IsFalse(isPublished, "Item should not have been published.");
        }

35. Example

Project: n2cms
Source File: IntegrityTests.cs
View license
[Test]
        public void CannotMoveItemOntoItself()
        {
            IntegrityPage page = new IntegrityPage();
            bool canMove = integrityManger.CanMove(page, page);
            Assert.IsFalse(canMove, "The page could be moved onto itself.");
        }

36. Example

Project: n2cms
Source File: IntegrityTests.cs
View license
[Test]
        public void CannotDeleteStartPage()
        {
            IntegrityStartPage startPage = new IntegrityStartPage();

            mocks.Record();
            Expect.On(parser).Call(parser.IsRootOrStartPage(startPage)).Return(true);
            mocks.Replay(parser);

            bool canDelete = integrityManger.CanDelete(startPage);
            Assert.IsFalse(canDelete, "Start page could be deleted");

            mocks.Verify(parser);
        }

37. Example

Project: n2cms
Source File: IntegrityTests.cs
View license
[Test]
        public void CannotCopyIfTypeIsntAllowed()
        {
            IntegrityStartPage startPage = new IntegrityStartPage();
            IntegrityPage page = new IntegrityPage();

            bool canCopy = integrityManger.CanCopy(startPage, page);
            Assert.IsFalse(canCopy, "The start page could be copied even though a page isn't an allowed destination.");
        }

38. Example

Project: n2cms
Source File: SecurityManagerTests.cs
View license
[Test]
        public void ExpiredIsNotPublished()
        {
            mocks.ReplayAll();

            ContentItem root = CreateOneItem<Items.SecurityPage>(1, "root", null);
            root.Expires = N2.Utility.CurrentTime();

            bool isPublished = security.IsPublished(root);
            Assert.IsFalse(isPublished, "Item should not have been published.");
        }

39. Example

Project: n2cms
Source File: IntegrityTests.cs
View license
[Test]
        public void CannotMoveIfTypeIsntAllowed()
        {
            IntegrityStartPage startPage = new IntegrityStartPage();
            IntegrityPage page = new IntegrityPage();

            bool canMove = integrityManger.CanMove(startPage, page);
            Assert.IsFalse(canMove, "The start page could be moved even though a page isn't an allowed destination.");
        }

40. Example

Project: nantcontrib
Source File: GetTaskTest.cs
View license
[Test]
        public void BuildDeletedTableDoesNotIncludeRegularItems() {
            MockVssItem regular = new MockVssItem();
            regular.Name = "regular";
            regular.Deleted = false;

            MockVssItems items = new MockVssItems();
            items.Add(regular);

            Hashtable table = _getTask.BuildDeletedTable(items);

            Assert.IsFalse((bool) table[regular.Name], "regular items should not be deleted");
        }

41. Example

View license
public static void ShouldBeFalse(this bool condition, string message)
    {
        Assert.IsFalse(condition, message);
    }

42. Example

Project: PDFCreator
Source File: ProfileCheckerTest.cs
View license
[Test]
        public void EmptyFolderForSaveDialog_EnabledAutosave_IsValid()
        {
            _profile.SaveDialog.SetDirectory = true;
            _profile.TargetDirectory = "";
            _profile.AutoSave.Enabled = true;
            var result = _profileChecker.ProfileCheck(_profile, _accounts);
            Assert.IsFalse(result.Contains(SaveDialog_NoPreselectedFolder), "ProfileCheck should ignore empty folder for save dialog if Autosave is enabled.");
        }

43. Example

View license
[Test]
        public void SetNoPasswordChecked_ValueIsFalse_SetPasswordActionWasNotCalled()
        {
            var wasCalled = false;
            _accountViewModel.SetPasswordAction = s => wasCalled = true;

            _accountViewModel.AskForPasswordLater = false;

            Assert.IsFalse(wasCalled, "SetPasswordAction");
        }

44. Example

Project: Platform
Source File: InnerTextTest.cs
View license
[Test]

        public void InnerTextDerived()
        {
            bool gotException = false;
            try
            {
                XmlTextDerived test = new XmlTextDerived() { ThisShouldBeInner = "Test1" };
                var result = XmlSerializer<XmlTextDerived>.New().SerializeToString(test);

            }
            catch (Exception)
            {

                gotException = true;
            }

            Assert.IsFalse(gotException, "This should be valid");
        }

45. Example

Project: JSON-RPC.NET
Source File: Test.cs
View license
[Test()]
        public void TestLeftOutParams()
        {
            var request =
                @"{""jsonrpc"":""2.0"",""method"":""ReturnsDateTime"",""id"":1}";

            var result = JsonRpcProcessor.Process(request);
            result.Wait();

            Assert.IsFalse(result.Result.Contains(@"error"":{""code"":-32602"), @"According to JSON-RPC 2.0 the ""params"" member MAY be omitted.");
        }

46. Example

Project: mongodb-csharp
Source File: TestOid.cs
View license
[Test]
        public void TestCtor()
        {
            var thrown = false;
            try
            {
                new Oid("4a7067c30a57000000008ecb");
            }
            catch(ArgumentException)
            {
                thrown = true;
            }
            Assert.IsFalse(thrown, "ID should be fine.");
        }

47. Example

Project: libpalaso
Source File: BCVRefTests.cs
View license
[Test]
		public void ParseRefString_IntroInvalid()
		{
			BCVRef reference = new BCVRef("JOS 2:0");
			Assert.IsFalse(reference.Valid, "Verse cannot be 0 except in chapter 1.");
		}

48. Example

Project: JSIL
Source File: FormattingTests.cs
View license
[Test]
        public void NoUnnecessaryCasts () {
            var testNames = new string[] {
                @"FailingTestCases\ArrayToString.cs",
                @"SimpleTestCases\CollectionInitializers.cs",
                @"TestCases\DictionaryInitializer2.cs",
            };

            RunComparisonTests(testNames, null, null, 
                (test) => false, 
                (csharp, js) => {
                    Assert.IsFalse(
                        js().Contains("JSIL.Cast("),
                        "JS output should not contain any casts"
                    );

                    Assert.IsFalse(
                        js().Contains("JSIL.TryCast("),
                        "JS output should not contain any casts"
                    );

                    Assert.IsFalse(
                        js().Contains(".$Cast"),
                        "JS output should not contain any casts"
                    );

                    Assert.IsFalse(
                        js().Contains(".$TryCast"),
                        "JS output should not contain any casts"
                    );
                }
            );
        }

49. Example

Project: JSIL
Source File: MetadataTests.cs
View license
[Test]
        public void ReplaceMethodBodyWithProxyMethodBody () {
            var generatedJs = GenericTest(
                @"SpecialTestCases\ReplaceMethodBody.cs",
                "ProxiedClass.ProxiedMethod",
                "ProxiedClassProxy.ProxiedMethod"
            );

            Assert.IsFalse(
                generatedJs.Contains("\"ProxiedClass.ProxiedMethod"),
                "Replaced methods should not have their body emitted"
            );
        }

50. Example

Project: JSIL
Source File: MetadataTests.cs
View license
[Test]
        public void ReplaceMethodBodyWithProxyMethodBodyAndCallOtherMethod () {
            var generatedJs = GenericTest(
                @"SpecialTestCases\ReplaceMethodBodyAndCallOtherMethod.cs",
                "ProxiedClass.ProxiedMethod\r\nProxiedClass.UnproxiedMethod",
                "ProxiedClassProxy.ProxiedMethod\r\nProxiedClass.UnproxiedMethod"
            );

            Assert.IsFalse(
                generatedJs.Contains("\"ProxiedClass.ProxiedMethod"),
                "Replaced methods should not have their body emitted"
            );
        }