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

Here are the examples of the csharp api class NUnit.Framework.Assert.IsTrue(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: MockMethod.cs
View license
public void Verify()
		{
			if ( expectedCalls != null )
				Assert.IsTrue( expectedCalls.Count == 0, "Not all methods were called" );
		}

2. Example

Project: ContinuousTests
Source File: MockMethod.cs
View license
public void Verify()
		{
			if ( expectedCalls != null )
				Assert.IsTrue( expectedCalls.Count == 0, "Not all methods were called" );
		}

3. Example

Project: ContinuousTests
Source File: MockMethod.cs
View license
public void Verify()
		{
			if ( expectedCalls != null )
				Assert.IsTrue( expectedCalls.Count == 0, "Not all methods were called" );
		}

4. Example

View license
[Test]
		public void ConstructorNullTargetType ()
		{
			// ok
			var c = new XamlValueConverter<TypeConverter> (typeof (Int32Converter), null);
			Assert.IsTrue (c.ConverterInstance is Int32Converter, "#1");
		}

5. Example

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

6. Example

View license
[Test]
		public void ConverterTargetMismatch ()
		{
			// ok
			var c = new XamlValueConverter<TypeConverter> (typeof (Int32Converter), XamlLanguage.String, null);
			Assert.IsTrue (c.ConverterInstance is Int32Converter, "#1");
		}

7. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsString_integer_string_evalutes_true()
        {
            var systemUnderTest = new ValueObject("5");
            Assert.IsTrue(systemUnderTest.IsString, "IsString should evaluate to true when ValueObject wraps a string that can be converted to an integer.");
        }

8. Example

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

9. Example

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

10. Example

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

11. Example

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

12. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsInt_integer_string_evaluates_true()
        {
            var systemUnderTest = new ValueObject("2");
            Assert.IsTrue(systemUnderTest.IsInt, "IsInt should evaluate to true when ValueObject wraps a string that can be converted to an integer.");
        }

13. Example

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

14. Example

Project: docopt.net
Source File: ValueObjectTests.cs
View license
[Test]
        public void IsList_genericlist_evaluates_true()
        {
            var systemUnderTest = new ValueObject(new List<object>());
            Assert.IsTrue(systemUnderTest.IsList, "IsList should evaluate to true when ValueObject wraps an implementation of ICollection.");
        }

15. Example

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

16. Example

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

17. Example

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

18. Example

Project: NPOI
Source File: TestBoundSheetRecord.cs
View license
[Test]
        public void TestName()
        {
            BoundSheetRecord record = new BoundSheetRecord("1234567890223456789032345678904");

            try
            {
                record.Sheetname = ("s//*s");
                Assert.IsTrue(false, "Should have thrown ArgumentException, but didnt");
            }
            catch (ArgumentException)
            {

            }

        }

19. Example

Project: DotSpatial
Source File: MapTest.cs
View license
[Test]
        public void ProjectionChangedEventFireTest()
        {
            bool eventIsFired = false;

            Map map = new Map();
            map.ProjectionChanged += (sender, args) => eventIsFired = true;

            const string Esri = "GEOGCS[\"GCS_North_American_1983\",DATUM[\"D_North_American_1983\",SPHEROID[\"GRS_1980\",6378137,298.257222101004]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.0174532925199433]]";
            map.ProjectionEsriString = Esri;

            Assert.IsTrue(eventIsFired, "the ProjectionChanged event should be fired when Map.ProjectionEsriString is changed.");
        }

20. Example

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

21. Example

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

22. Example

Project: impromptu-interface
Source File: ClayTest.cs
View license
[Test]
        public void InvokeMemberContainsNameWithImpromptuInterface()
        {
            var clay = new Clay(new TestBehavior()).ActLike<ISimpeleClassMeth>();
            var result = clay.Action3();
            Assert.IsTrue(result.Contains("[name:Action3]"), "Does Not Match Argument Name");
            Assert.IsTrue(result.Contains("[count:0]"), "Does Not Match Argument Count");

        }

23. Example

Project: impromptu-interface
Source File: ClayTest.cs
View license
[Test]
        public void InvokeMemberContainsNameWithImpromptuInvoke()
        {
            var clay = new Clay(new TestBehavior());
            var result = Dynamic.InvokeMember(clay, "Help", "Test");
            Assert.IsTrue(result.Contains("[name:Help]"), "Does Not Match Argument Name");
            Assert.IsTrue(result.Contains("[count:1]"), "Does Not Match Argument Count");

        }

24. Example

Project: nesper
Source File: TestStaticFunctions.cs
View license
[Test]
        public void TestPerfConstantParameters()
        {
            if (InstrumentationHel/n ..... /n //View Source file for more details /n }

25. Example

Project: nesper
Source File: TestVariableService.cs
View license
[Test]
        public void TestPerfSetVersion()
        {
            long start = PerformanceObserver.MilliTime;
            for (int i = 0; i < 100000; i++) {
                _service.SetLocalVersion();
            }
            long end = PerformanceObserver.MilliTime;
            long delta = (end - start);
            Assert.IsTrue(delta < 100, "delta=" + delta);
        }

26. Example

Project: nesper
Source File: TestStaticFunctions.cs
View license
[Test]
        public void TestPerfConstantParametersNested()
        {
            var configuration = SupportConfigFactory.GetConfiguration();
            configuration.AddImport(typeof(SupportStaticMethodLib).FullName);
            configuration.AddEventType("Temperature", typeof(SupportTemperatureBean));
            _epService = EPServiceProviderManager.GetDefaultProvider(configuration);
            _epService.Initialize();

            var text = "select " +
                    "SupportStaticMethodLib.Sleep(SupportStaticMethodLib.Passthru(100)) as val" +
                    " from Temperature as temp";
            var stmt = _epService.EPAdministrator.CreateEPL(text);
            var listener = new SupportUpdateListener();
            stmt.Events += listener.Update;

            long startTime = Environment.TickCount;
            for (var i = 0; i < 500; i++)
            {
                _epService.EPRuntime.SendEvent(new SupportTemperatureBean("a"));
            }
            long endTime = Environment.TickCount;
            var delta = endTime - startTime;

            Assert.IsTrue(delta < 1000, "Failed perf test, delta=" + delta);
        }

27. Example

Project: nesper
Source File: TestDeadPattern.cs
View license
[Test]
        public void TestWithDeadPattern()
        {
            String pattern = "(A() -> B()) and not C()";
            // Adjust to 20000 to better test the limit
            for (int i = 0; i < 1000; i++)
            {
                epService.EPAdministrator.CreatePattern(pattern);
            }
    
            epService.EPRuntime.SendEvent(new SupportBean_C("C1"));
    
            long startTime = PerformanceObserver.MilliTime;
            epService.EPRuntime.SendEvent(new SupportBean_A("A1"));
            long delta =  PerformanceObserver.MilliTime - startTime;
    
            log.Info(".testDeadPattern delta=" + delta);
            Assert.IsTrue(delta < 20, "performance: delta=" + delta);
        }

28. Example

Project: SharpZipLib
Source File: ChecksumTests.cs
View license
private void exceptionTesting(IChecksum crcUnderTest)
		{

			bool exception = false;

			try {
				/n ..... /n //View Source file for more details /n }

29. Example

Project: SharpZipLib
Source File: LzwTests.cs
View license
[Test]
		[Category("LZW")]
		public void ZeroLengthInputStream()
		{
			var lis = new LzwInputStream(new MemoryStream());
			bool exception = false;
			try {
				lis.ReadByte();
			} catch {
				exception = true;
			}

			Assert.IsTrue(exception, "reading from an empty stream should cause an exception");
		}

30. Example

View license
[Test]
        public void UnsupportedTrackers ()
        {
            RawTrackerTier tier = new RawTrackerTier {
                "fake://123.123.123.2:5665"
            };
            rig.Torrent.AnnounceUrls.Add (tier);
            TorrentManager manager = new TorrentManager (rig.Torrent, "", new TorrentSettings());
            foreach (MonoTorrent.Client.Tracker.TrackerTier t in manager.TrackerManager)
            {
                Assert.IsTrue (t.Trackers.Count > 0, "#1");
            }
        }

31. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void Assert(string message, bool condition) 
		{
			NUnit.Framework.Assert.IsTrue(condition, message);
		}

32. Example

Project: 32feet
Source File: Assertion.cs
View license
static public void Assert(string message, bool condition) 
		{
			NUnit.Framework.Assert.IsTrue(condition, message);
		}

33. Example

Project: ActivityManager
Source File: LzwTests.cs
View license
[Test]
        [Category("LZW")]
        public void ZeroLengthInputStream() {
            LzwInputStream lis = new LzwInputStream(new MemoryStream());
            bool exception = false;
            try {
                lis.ReadByte();
            } catch {
                exception = true;
            }

            Assert.IsTrue(exception, "reading from an empty stream should cause an exception");
        }

34. Example

Project: mathnet-numerics
Source File: ComplexTest.cs
View license
[Test]
        public void CanDetermineIfNaN()
        {
            var complex = new Complex(double.NaN, 1);
            Assert.IsTrue(complex.IsNaN(), "Real part is NaN.");
            complex = new Complex(1, double.NaN);
            Assert.IsTrue(complex.IsNaN(), "Imaginary part is NaN.");
            complex = new Complex(double.NaN, double.NaN);
            Assert.IsTrue(complex.IsNaN(), "Both parts are NaN.");
        }

35. Example

Project: mathnet-numerics
Source File: ComplexTest.cs
View license
[Test]
        public void CanDetermineIfZeroValueComplexNumber()
        {
            var complex = new Complex(0, 0);
            Assert.IsTrue(complex.IsZero(), "Zero complex number.");
        }

36. Example

Project: mathnet-numerics
Source File: ComplexTest.cs
View license
[Test]
        public void CanDetermineIfRealNumber()
        {
            var complex = new Complex(-1, 0);
            Assert.IsTrue(complex.IsReal(), "Is a real number.");
        }

37. Example

Project: mathnet-numerics
Source File: ComplexTest.cs
View license
[Test]
        public void CanDetermineIfInfinity()
        {
            var complex = new Complex(double.PositiveInfinity, 1);
            Assert.IsTrue(complex.IsInfinity(), "Real part is infinity.");
            complex = new Complex(1, double.NegativeInfinity);
            Assert.IsTrue(complex.IsInfinity(), "Imaginary part is infinity.");
            complex = new Complex(double.NegativeInfinity, double.PositiveInfinity);
            Assert.IsTrue(complex.IsInfinity(), "Both parts are infinity.");
        }

38. Example

Project: mathnet-numerics
Source File: ComplexTest.cs
View license
[Test]
        public void CanDetermineIfImaginaryUnit()
        {
            var complex = new Complex(0, 1);
            Assert.IsTrue(complex.IsImaginaryOne(), "Imaginary unit");
        }

39. Example

Project: mathnet-numerics
Source File: ComplexTest.cs
View license
[Test]
        public void CanDetermineIfOneValueComplexNumber()
        {
            var complex = new Complex(1, 0);
            Assert.IsTrue(complex.IsOne(), "Complex number with a value of one.");
        }

40. Example

Project: mathnet-numerics
Source File: ComplexTest.cs
View license
[Test]
        public void CanDetermineIfRealNonNegativeNumber()
        {
            var complex = new Complex(1, 0);
            Assert.IsTrue(complex.IsReal(), "Is a real non-negative number.");
        }

41. Example

Project: NStack
Source File: ustringTest.cs
View license
[Test]
		public void TestReplace ()
		{
			ustring.Make ("banana").Replace ("", "<>", -1);
			foreach ((var input, var oldv, var newv, var n, var expected) in replaceTexts) {
				var sin = ustring.Make (input);
				var result = sin.Replace (oldv, newv, n);
				Assert.IsTrue (result == expected, $"For test on Replace (\"{input}\",\"{oldv}\",\"{newv}\",{n}) got {result}");
			}
		}

42. Example

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

43. Example

Project: DReAM
Source File: CookieTests.cs
View license
[Test]
        public void Fetch_cookie_from_dreamcontext_jar_with_local_uri() {
            using(D/n ..... /n //View Source file for more details /n }

44. Example

Project: DReAM
Source File: DataUpdaterTests.cs
View license
[Test]
        public void load_and_execute() {
            _dataUpdater.LoadMethodsAndExecute(_testAssembly);
            Assert.IsTrue(DummyUpgradeClass.ExecutedMethods.Count > 0, "No Methods were executed");
        }

45. Example

Project: taglib-sharp
Source File: M4aFormatTest.cs
View license
[Test]
		public void bgo_676934 ()
		{
			// This file contains an atom which says its 800MB in size
			var file = File.Create (TestPath.Samples + "bgo_676934.m4a");
			Assert.IsTrue (file.CorruptionReasons.Any (), "#1");
		}

46. Example

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

47. Example

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

            bool canSave = integrityManger.CanSave(startPage);
            Assert.IsTrue(canSave, "Couldn't save");
        }

48. Example

Project: n2cms
Source File: TypeAssert.cs
View license
public static void Is<T>(object instance)
        {
            Assert.IsTrue(instance is T, "Instance " + instance + " was not of type " + typeof(T));
        }

49. Example

Project: n2cms
Source File: IntegrityTests.cs
View license
[Test]
        public void CanMoveItem()
        {
            IntegrityStartPage startPage = new IntegrityStartPage();
            IntegrityPage page = new IntegrityPage();
            bool canMove = integrityManger.CanMove(page, startPage);
            Assert.IsTrue(canMove, "The page couldn't be moved to the destination.");
        }

50. Example

Project: n2cms
Source File: DefinitionTests.cs
View license
[Test]
        public void NoAllowedZones_DefaultsTo_AllZonesAllowed()
        {
            ItemDefinition menuDefinition = definitions.GetDefinition(typeof (DefinitionMenuItem));
            bool isAllowed = menuDefinition.IsAllowedInZone("NotQuiteTheZoneYouExpectedPunk");
            Assert.IsTrue(isAllowed, "Wasn't allowed in the zone.");
        }