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

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

92 Examples 7

1. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorGreaterThanOrEqual_MoreTicks_IsFalse()
        {
            Assert.False(one >= threeMillion, "1 >= 3,000,000");
            Assert.False(negativeFiftyMillion >= negativeOne, "-50,000,000 >= -1");
            Assert.False(Instant.MinValue >= Instant.MaxValue, "MinValue >= MaxValue");
        }

2. Example

View license
[Test]
        public void OperatorGreaterThan_EqualTicks_IsFalse()
        {
            Assert.False(one > onePrime, "1 > 1 (different objects)");
        }

3. Example

View license
[Test]
        public void OperatorGreaterThan_MoreTicks_IsFalse()
        {
            Assert.False(one > threeMillion, "1 > 3,000,000");
            Assert.False(negativeFiftyMillion > negativeOne, "-50,000,000 > -1");
            Assert.False(LocalInstant.MinValue > LocalInstant.MaxValue, "MinValue > MaxValue");
        }

4. Example

View license
[Test]
        public void OperatorLessThan_Self_IsFalse()
        {
            // Warning CS1718: Comparison made to same variable; did you mean to compare something else?
            // This is intentional for testing
#pragma warning disable 1718
            Assert.False(one < one, "1 < 1 (same object)");
#pragma warning restore 1718
        }

5. Example

View license
[Test]
        public void OperatorNotEquals_ToSelf_IsFalse()
        {
            // Warning CS1718: Comparison made to same variable; did you mean to compare something else?
            // This is intentional for testing
#pragma warning disable 1718
            Assert.False(one != one, "1 != 1 (same object)");
#pragma warning restore 1718
        }

6. Example

View license
[Test]
        public void OperatorLessThanOrEqual_LessTicks_IsFalse()
        {
            Assert.False(threeMillion <= one, "3,000,000 <= 1");
            Assert.False(negativeOne <= negativeFiftyMillion, "-1 <= -50,000,000");
            Assert.False(LocalInstant.MaxValue <= LocalInstant.MinValue, "MaxValue <= MinValue");
        }

7. Example

View license
[Test]
        public void OperatorEquals_WithDifferentTicks_IsFalse()
        {
            Assert.False(one == negativeOne, "1 == -1");
            Assert.False(one == threeMillion, "1 == 3,000,000");
            Assert.False(one == negativeFiftyMillion, "1 == -50,000,000");
            Assert.False(LocalInstant.MinValue == LocalInstant.MaxValue, "MinValue == MaxValue");
        }

8. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorNotEquals_WithEqualTicks_IsFalse()
        {
            Assert.False(one != onePrime, "1 != 1 (different objects)");
        }

9. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorLessThan_EqualTicks_IsFalse()
        {
            Assert.False(one < onePrime, "1 < 1 (different objects)");
        }

10. Example

View license
[Test]
        public void OperatorNotEquals_WithEqualTicks_IsFalse()
        {
            Assert.False(one != onePrime, "1 != 1 (different objects)");
        }

11. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorNotEquals_ToSelf_IsFalse()
        {
            // Warning CS1718: Comparison made to same variable; did you mean to compare something else?
            // This is intentional for testing
#pragma warning disable 1718
            Assert.False(one != one, "1 != 1 (same object)");
#pragma warning restore 1718
        }

12. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorLessThan_Self_IsFalse()
        {
            // Warning CS1718: Comparison made to same variable; did you mean to compare something else?
            // This is intentional for testing
#pragma warning disable 1718
            Assert.False(one < one, "1 < 1 (same object)");
#pragma warning restore 1718
        }

13. Example

View license
[Test]
        public void OperatorGreaterThanOrEqual_MoreTicks_IsFalse()
        {
            Assert.False(one >= threeMillion, "1 >= 3,000,000");
            Assert.False(negativeFiftyMillion >= negativeOne, "-50,000,000 >= -1");
            Assert.False(LocalInstant.MinValue >= LocalInstant.MaxValue, "MinValue >= MaxValue");
        }

14. Example

View license
[Test]
        public void OperatorGreaterThan_Self_IsFalse()
        {
            // Warning CS1718: Comparison made to same variable; did you mean to compare something else?
            // This is intentional for testing
#pragma warning disable 1718
            Assert.False(one > one, "1 > 1 (same object)");
#pragma warning restore 1718
        }

15. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorLessThan_LessTicks_IsFalse()
        {
            Assert.False(threeMillion < one, "3,000,000 < 1");
            Assert.False(negativeOne < negativeFiftyMillion, "-1 < -50,000,000");
            Assert.False(Instant.MaxValue < Instant.MinValue, "MaxValue < MinValue");
        }

16. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorGreaterThan_MoreTicks_IsFalse()
        {
            Assert.False(one > threeMillion, "1 > 3,000,000");
            Assert.False(negativeFiftyMillion > negativeOne, "-50,000,000 > -1");
            Assert.False(Instant.MinValue > Instant.MaxValue, "MinValue > MaxValue");
        }

17. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorEquals_WithDifferentTicks_IsFalse()
        {
            Assert.False(one == negativeOne, "1 == -1");
            Assert.False(one == threeMillion, "1 == 3,000,000");
            Assert.False(one == negativeFiftyMillion, "1 == -50,000,000");
            Assert.False(Instant.MinValue == Instant.MaxValue, "MinValue == MaxValue");
        }

18. Example

Project: Chess.NET
Source File: MoveTests.cs
View license
[Test]
        public static void TestInequality_OneIsNull()
        {
            Position position1 = new Position(File.G, 4);
            Position position2 = new Position(File.G, 8);
            Move move1 = new Move(position1, position2, Player.Black);
            Move move2 = null;
            Assert.False(move1 == move2, "move1 == move2 should be false");
            Move move3 = null;
            Move move4 = new Move(position1, position2, Player.Black);
            Assert.False(move3 == move4, "move3 == move4 should be false");
        }

19. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorGreaterThan_Self_IsFalse()
        {
            // Warning CS1718: Comparison made to same variable; did you mean to compare something else?
            // This is intentional for testing
#pragma warning disable 1718
            Assert.False(one > one, "1 > 1 (same object)");
#pragma warning restore 1718
        }

20. Example

Project: nunit
Source File: PlatformDetectionTests.cs
View license
[Test]
        public void PlatformAttribute_ProcessBitNess()
        {
            PlatformAttribute attr32 = new PlatformAttribute("32-Bit");
            PlatformAttribute attr64 = new PlatformAttribute("64-Bit");
            PlatformHelper helper = new PlatformHelper();

            // This test verifies that the two labels are known,
            // do not cause an error and return consistent results.
            bool is32BitProcess = helper.IsPlatformSupported(attr32);
            bool is64BitProcess = helper.IsPlatformSupported(attr64);
            Assert.False(is32BitProcess & is64BitProcess, "Process cannot be both 32 and 64 bit");

#if ASYNC
            // For .NET 4.0 and 4.5, we can check further
            Assert.That(is64BitProcess, Is.EqualTo(Environment.Is64BitProcess));
#endif
        }

21. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorLessThanOrEqual_LessTicks_IsFalse()
        {
            Assert.False(threeMillion <= one, "3,000,000 <= 1");
            Assert.False(negativeOne <= negativeFiftyMillion, "-1 <= -50,000,000");
            Assert.False(Instant.MaxValue <= Instant.MinValue, "MaxValue <= MinValue");
        }

22. Example

View license
[Test]
        public void OperatorLessThan_EqualTicks_IsFalse()
        {
            Assert.False(one < onePrime, "1 < 1 (different objects)");
        }

23. Example

View license
[Test]
        public async Task Should_not_autoSubscribe_messages_handled_by_sagas_if_asked_to()
        {
            var context = await Scenario.Define<Context>()
                .WithEndpoint<Subscriber>(g => g.CustomConfig(c => c.AutoSubscribe().DoNotAutoSubscribeSagas()))
                .Done(c => c.EndpointsStarted)
                .Run();

            Assert.False(context.EventsSubscribedTo.Any(), "Events only handled by sagas should not be auto subscribed");
        }

24. Example

Project: linq2db
Source File: InheritanceTests.cs
View license
[Test, DataContextSource(false)]
		public void Test17(string data)
		{
			using (var context = GetDataContext(data))
			{
				var db = (TestDataConnection)context;
				db.GetTable<Test17Person>().OfType<Test17John>().ToList();
				Assert.False(db.LastQuery.ToLowerInvariant().Contains("lastname"), "Why select LastName field??");
			}
		}

25. Example

View license
[Test]
        public void OperatorLessThan_LessTicks_IsFalse()
        {
            Assert.False(threeMillion < one, "3,000,000 < 1");
            Assert.False(negativeOne < negativeFiftyMillion, "-1 < -50,000,000");
            Assert.False(LocalInstant.MaxValue < LocalInstant.MinValue, "MaxValue < MinValue");
        }

26. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void OperatorGreaterThan_EqualTicks_IsFalse()
        {
            Assert.False(one > onePrime, "1 > 1 (different objects)");
        }

27. Example

View license
public void testFirstLayerBedTemperatureNotInStartGcode(PrinterSettingsLayer layer, string sourceFile)
		{
			string settingValue;
			if (!layer.TryGetValue("start_gcode", out settingValue))
			{
				return;
			}

			Assert.False(settingValue.Contains("first_layer_bed_temperature"), "start_gcode should not contain first_layer_bed_temperature: " + sourceFile);
		}

28. Example

Project: Pash
Source File: MonoTests.cs
View license
[Test]
        public void MonoGetDrivesBug11923()
        {
            var drives = System.IO.DriveInfo.GetDrives();
            Assert.False(drives.Length == 1 && drives[0].Name.Length == 0, "You are hitting Mono bug https://bugzilla.xamarin.com/show_bug.cgi?id=11923");
        }

29. Example

View license
public void testFirstLayerTempNotInStartGcode(PrinterSettingsLayer layer, string sourceFile)
		{
			string settingValue;
			if (!layer.TryGetValue("start_gcode", out settingValue))
			{
				return;
			}

			Assert.False(settingValue.Contains("first_layer_temperature"), "start_gcode should not contain first_layer_temperature: " + sourceFile);
		}

30. Example

View license
public void noCurlyBracketsInEndGcode(PrinterSettingsLayer layer, string sourceFile)
		{
			string settingValue;
			if (!layer.TryGetValue("end_gcode", out settingValue))
			{
				return;
			}

			Assert.False(settingValue.Contains("{"), "end_gcode should not contain braces: " + sourceFile);
		}

31. Example

View license
[Test]
        public void ObjectEquals_ToNull_IsFalse()
        {
            object oOne = one;

            Assert.False(oOne.Equals(null), "1 == null");
        }

32. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void ObjectEquals_ToNull_IsFalse()
        {
            object oOne = one;

            Assert.False(oOne.Equals(null), "1 == null");
        }

33. Example

View license
[Test]
        public Task Should_autosubscribe_to_relevant_messagetypes()
        {
            return Scenario.Define<Context>()
                .WithEndpoint<Subscriber>()
                .Done(c => c.EventsSubscribedTo.Count >= 1)
                .Repeat(b => b.For<AllTransportsWithMessageDrivenPubSub>())
                .Should(ctx => Assert.True(ctx.EventsSubscribedTo.Contains(typeof(MyEvent)), "Events should be auto subscribed"))
                .Should(ctx => Assert.False(ctx.EventsSubscribedTo.Contains(typeof(MyEventWithNoRouting)), "Events without routing should not be auto subscribed"))
                .Should(ctx => Assert.False(ctx.EventsSubscribedTo.Contains(typeof(MyEventWithNoHandler)), "Events without handlers should not be auto subscribed"))
                .Should(ctx => Assert.False(ctx.EventsSubscribedTo.Contains(typeof(MyCommand)), "Commands should not be auto subscribed"))
                .Should(ctx => Assert.False(ctx.EventsSubscribedTo.Contains(typeof(MyMessage)), "Plain messages should not be auto subscribed by default"))
                .Run();
        }

34. Example

View license
[Test]
        public async Task Message_should_be_moved_to_error_cause_handler_not_found()
        {
            var context = await Scenario.Define<Context>()
                .WithEndpoint<Sender>(c => c.When(s => s.Send(new MyCommand())))
                .WithEndpoint<Receiver>(c => c.DoNotFailOnErrorMessages())
                .Done(c => c.FailedMessages.Any())
                .Run();

            Assert.True(context.Logs.Any(l => l.Level == LogLevel.Error && l.Message.Contains($"No handlers could be found for message type: { typeof(MyCommand).FullName}")), "No handlers could be found was not logged.");
            Assert.False(context.Logs.Any(l => l.Level == LogLevel.Warn && l.Message.Contains($"Message header '{ typeof(MyCommand).FullName }' was mapped to type '{ typeof(MyCommand).FullName }' but that type was not found in the message registry, ensure the same message registration conventions are used in all endpoints, especially if using unobtrusive mode.")), "Message type could not be mapped.");
            Assert.False(context.Logs.Any(l => l.Level == LogLevel.Warn && l.Message.Contains($"Could not determine message type from message header '{ typeof(MyCommand).FullName}'")), "Message type could not be mapped.");
        }

35. Example

View license
[Test]
        public void ObjectEquals_WithDifferentTicks_IsFalse()
        {
            object oOne = one;
            object oNegativeOne = negativeOne;
            object oThreeMillion = threeMillion;
            object oNegativeFiftyMillion = negativeFiftyMillion;
            object oMinimum = LocalInstant.MinValue;
            object oMaximum = LocalInstant.MaxValue;

            Assert.False(oOne.Equals(oNegativeOne), "1 == -1");
            Assert.False(oOne.Equals(oThreeMillion), "1 == 3,000,000");
            Assert.False(oOne.Equals(oNegativeFiftyMillion), "1 == -50,000,000");
            Assert.False(oMinimum.Equals(oMaximum), "MinValue == MaxValue");
        }

36. Example

Project: NodaTime
Source File: InstantTest.Operators.cs
View license
[Test]
        public void ObjectEquals_WithDifferentTicks_IsFalse()
        {
            object oOne = one;
            object oNegativeOne = negativeOne;
            object oThreeMillion = threeMillion;
            object oNegativeFiftyMillion = negativeFiftyMillion;
            object oMinimum = Instant.MinValue;
            object oMaximum = Instant.MaxValue;

            Assert.False(oOne.Equals(oNegativeOne), "1 == -1");
            Assert.False(oOne.Equals(oThreeMillion), "1 == 3,000,000");
            Assert.False(oOne.Equals(oNegativeFiftyMillion), "1 == -50,000,000");
            Assert.False(oMinimum.Equals(oMaximum), "MinValue == MaxValue");
        }

37. Example

Project: gauge-csharp
Source File: AssertEx.cs
View license
public static void DoesNotInheritsFrom<TBase, TDerived>()
        {
            Assert.False(typeof(TDerived).IsSubclassOf(typeof(TBase)),
                string.Format("Expected {0} to NOT be a subclass of {1}", typeof(TDerived).FullName,
                    typeof(TBase).FullName));
        }

38. Example

View license
[Test]
		public void PrepareStylesheetExport_Works()
		{
			// SUT
			var styleSheetFile = Dictionar/n ..... /n //View Source file for more details /n }

39. Example

Project: Pash
Source File: TabExpansionProviderTests.cs
View license
[TestCase("", new [] { "Select-Object ", "New-Variable ", "Out-Default ", "Write-Host " }, new [] { "MyFunction " })]
        [TestCase("Ne", new [] {"New-Variable ", "New-Alias " }, new [] { "Select-Object ", "Out-Default ", "Write-Host ", "MyFunction " })]
        [TestCase("Neww", new string[]{}, new [] {"New-Variable ", "New-Alias ", "Select-Object ", "Out-Default ", "Write-Host ", "Prompt " })]
        public void TabExpansionKnowsCommands(string prefix, string[] shouldContain, string[] shouldntContain)
        {
            var expansions = new List<string>(_tabExp.GetCommandExpansions("", prefix));
            foreach (var str in shouldContain)
            {
                Assert.True(expansions.Contains(str), "Expansions doesn't contain " + str);
            }
            foreach (var str in shouldntContain)
            {
                Assert.False(expansions.Contains(str), "Expansions contains " + str);
            }
        }

40. Example

Project: OrionSDK
Source File: EntityMetadataTest.cs
View license
[Test]
        public void EntityMetadata_Descendants()
        {
            EntityMetadata grandparent = new EntityMetadata("Harry");
            EntityMetadata parent = new EntityMetadata("David");
            EntityMetadata child = new EntityMetadata("Morgen");

            grandparent.AddClassRelationships(parent);
            parent.AddClassRelationships(child);

            List<EntityMetadata> descendants = grandparent.Descendants.ToList();

            Assert.True(descendants.Contains(parent), "Grandparent is missing parent");
            Assert.True(descendants.Contains(child), "Grandparent is missing child");
            Assert.False(descendants.Contains(grandparent), "Grandparent is not a descendant of himself");
        }

41. Example

Project: MatterControl
Source File: OemProfileTests.cs
View license
[Test]
		public void NoFirstLayerBedTempInStartGcode()
		{
			ValidateOnAllPrinters((printer, settings) =>
			{
				string startGcode = settings.GetValue("start_gcode");
				Assert.False(startGcode.Contains("first_layer_bed_temperature"), "[start_gcode] should not contain [first_layer_bed_temperature]" + printer.RelativeFilePath);
			});
		}

42. Example

View license
[Test]
        public void DoesBucketExistTestWithBucketExist()
        {
            const string bucketName = "exist-bucket";
            try {
                var result = _ossClient.CreateBucket(bucketName);
                Assert.AreEqual(bucketName, result.Name);

                bool isExist = _ossClient.DoesBucketExist(bucketName);
                Assert.IsTrue(isExist);
            }
            catch (Exception e)
            {
                Assert.False(true, e.Message);
            }
            finally
            {
                OssTestUtils.CleanBucket(_ossClient, bucketName);
            }
        }

43. Example

View license
[TearDown]
        public void BaseTearDown()
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();
            Assert.False(wasUnobservedException, "UnobservedTaskException occured.");
            wasUnobservedException = false;
        }

44. Example

Project: talifun-web
Source File: CreateInstanceTest.cs
View license
[Test]
         public void CreateCrusherTask()
         {
             var buildEngine = new BuildEngingStub();

             var crusherTask = new CrusherTask
                 {
                     BinDirectoryPath = Environment.CurrentDirectory,
                     ConfigFilePath = Path.Combine(Environment.CurrentDirectory, "Talifun.Crusher.Tests.dll.config"),
                     BuildEngine = buildEngine,
                     HostObject = null
                 };

             crusherTask.Execute();

             Assert.False(buildEngine.BuildErrorEventArgs.Any(), buildEngine.BuildErrorEventArgs.Any() ? buildEngine.BuildErrorEventArgs.First().Message : string.Empty);
         }

45. Example

Project: Chess.NET
Source File: ChessPieceTests.cs
View license
[Test]
        public static void TestInEquality_OneIsNull()
        {
            Piece piece1 = new Rook(Player.White);
            Piece piece2 = null;
            Assert.AreNotEqual(piece1, piece2, "piece1 and piece2 are equal");
            Assert.False(piece1.Equals(piece2), "piece1.Equals(piece2) should be false");
            Assert.False(piece1 == piece2, "piece1 == piece2 should be false");
            Assert.False(piece2 == piece1, "piece2 == piece1 should be false");
            Assert.True(piece1 != piece2, "piece1 != piece2 should be True");
            Assert.True(piece2 != piece1, "piece2 != piece1 should be True");

            piece1 = null;
            piece2 = new Bishop(Player.Black);
            Assert.AreNotEqual(piece1, piece2, "piece1 and piece2 are equal");
            Assert.False(piece2.Equals(piece1), "piece1.Equals(piece2) should be false");
            Assert.False(piece1 == piece2, "piece1 == piece2 should be false");
            Assert.False(piece2 == piece1, "piece2 == piece1 should be false");
            Assert.True(piece1 != piece2, "piece1 != piece2 should be True");
            Assert.True(piece2 != piece1, "piece2 != piece1 should be True");
        }

46. Example

Project: Chess.NET
Source File: MoveTests.cs
View license
[Test]
        public static void TestEquality()
        {
            Position position1 = new Position(File.G, 4);
            Position position2 = new Position(File.H, 5);
            Position position3 = new Position(File.G, 4);
            Position position4 = new Position(File.H, 5);
            Move move1 = new Move(position1, position2, Player.White);
            Move move2 = new Move(position3, position4, Player.White);
            Move move3 = null;
            Move move4 = null;
            Assert.AreEqual(move1, move2, "move1 and move2 should be equal");
            Assert.True(move1.Equals(move2), "move1.Equals(move2) should be true");
            Assert.True(move2.Equals(move1), "move2.Equals(move1) should be true");
            Assert.True(move1 == move2, "move1 == move2 should be true");
            Assert.True(move2 == move1, "move2 == move1 should be true");
            Assert.True(move3 == move4, "move3 == move4 should be True");
            Assert.False(move1 != move2, "move1 != move2 should be false");
            Assert.False(move2 != move1, "move2 != move1 should be false");
            Assert.AreEqual(move1.GetHashCode(), move2.GetHashCode());
        }

47. Example

Project: Chess.NET
Source File: DetailedMoveTests.cs
View license
[Test]
        public static void TestInequality_DifferentPiece()
        {
            DetailedMove move1 = new DetailedMove(new Position(File.E, 2), new Position(File.E, 4), Player.White, null, new Pawn(Player.White), false, CastlingType.None);
            DetailedMove move2 = new DetailedMove(new Position(File.E, 2), new Position(File.E, 4), Player.White, null, new Queen(Player.White), false, CastlingType.None);
            Assert.AreNotEqual(move1, move2, "move1 and move2 are equal");
            Assert.False(move1.Equals(move2), "move1.Equals(move2) should be false");
            Assert.False(move2.Equals(move1), "move2.Equals(move1) should be false");
            Assert.True(move1 != move2, "move1 != move2 should be true");
            Assert.True(move2 != move1, "move2 != move1 should be true");
            Assert.False(move1 == move2, "move1 == move2 should be true");
            Assert.False(move2 == move1, "move2 == move1 should be true");
            Assert.AreNotEqual(move1.GetHashCode(), move2.GetHashCode());
        }

48. Example

Project: Chess.NET
Source File: ChessPieceTests.cs
View license
[Test]
        public static void TestInequality_DifferentPiece()
        {
            Piece piece1 = new King(Player.Black);
            Piece piece2 = new Queen(Player.Black);
            Assert.AreNotEqual(piece1, piece2, "piece1 and piece2 are equal");
            Assert.False(piece1.Equals(piece2), "piece1.Equals(piece2) should be false");
            Assert.False(piece2.Equals(piece1), "piece2.Equals(piece1) should be false");
            Assert.False(piece1 == piece2, "piece1 == piece2 should be false");
            Assert.False(piece2 == piece1, "piece2 == piece1 should be false");
            Assert.True(piece1 != piece2, "piece1 != piece2 should be True");
            Assert.True(piece2 != piece1, "piece2 != piece1 should be True");
            Assert.AreNotEqual(piece1.GetHashCode(), piece2.GetHashCode(), "Hash codes are equal");
        }

49. Example

Project: Chess.NET
Source File: MoveTests.cs
View license
[Test]
        public static void TestInequality_DifferentRankAndFile()
        {
            Position position1 = new Position(File.G, 4);
            Position position2 = new Position(File.H, 5);
            Position position3 = new Position(File.A, 1);
            Position position4 = new Position(File.B, 2);
            Move move1 = new Move(position1, position2, Player.White);
            Move move2 = new Move(position3, position4, Player.White);
            Assert.AreNotEqual(move1, move2, "move1 and move2 are equal");
            Assert.False(move1.Equals(move2), "move1.Equals(move2) should be false");
            Assert.False(move2.Equals(move1), "move2.Equals(move1) should be false");
            Assert.True(move1 != move2, "move1 != move2 should be true");
            Assert.True(move2 != move1, "move2 != move1 should be true");
            Assert.False(move1 == move2, "move1 == move2 should be true");
            Assert.False(move2 == move1, "move2 == move1 should be true");
            Assert.AreNotEqual(move1.GetHashCode(), move2.GetHashCode());
        }

50. Example

Project: Chess.NET
Source File: DetailedMoveTests.cs
View license
[Test]
        public static void TestInequality_DifferentIsCapture()
        {
            DetailedMove move1 = new DetailedMove(new Position(File.E, 2), new Position(File.E, 4), Player.White, null, new Queen(Player.White), true, CastlingType.None);
            DetailedMove move2 = new DetailedMove(new Position(File.E, 2), new Position(File.E, 4), Player.White, null, new Queen(Player.White), false, CastlingType.None);
            Assert.AreNotEqual(move1, move2, "move1 and move2 are equal");
            Assert.False(move1.Equals(move2), "move1.Equals(move2) should be false");
            Assert.False(move2.Equals(move1), "move2.Equals(move1) should be false");
            Assert.True(move1 != move2, "move1 != move2 should be true");
            Assert.True(move2 != move1, "move2 != move1 should be true");
            Assert.False(move1 == move2, "move1 == move2 should be true");
            Assert.False(move2 == move1, "move2 == move1 should be true");
            Assert.AreNotEqual(move1.GetHashCode(), move2.GetHashCode());
        }