NUnit.Framework.Assert.AreNotEqual(object, object)

Here are the examples of the csharp api class NUnit.Framework.Assert.AreNotEqual(object, object) 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: NotEqualFixture.cs
View license
[Test, ExpectedException( typeof( AssertionException ) )]
		public void NullEqualsNull()
		{
			expectedMessage =
				"  Expected: not null" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.AreNotEqual( null, null );
		}

2. Example

Project: ContinuousTests
Source File: TestTreeTests.cs
View license
[Test]
		public void NonMatchingTreesAreNotEqual()
		{
			Assert.AreNotEqual( tree1, tree4 ); 
			Assert.AreNotEqual( tree2, tree4 ); 
			Assert.AreNotEqual( tree3, tree4 ); 
		}

3. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test, ExpectedException( typeof( AssertionException ) )]
		public void ArraysNotEqualFails()
		{
			expectedMessage =
				"  Expected: not < 1, 2, 3 >" + Environment.NewLine +
				"  But was:  < 1, 2, 3 >" + Environment.NewLine;
			Assert.AreNotEqual( new object[] { 1, 2, 3 }, new object[] { 1, 2, 3 } );
		}

4. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test, ExpectedException( typeof( AssertionException ) )]
		public void NullEqualsNull()
		{
			expectedMessage =
				"  Expected: not null" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.AreNotEqual( null, null );
		}

5. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test]
		public void ArraysNotEqual()
		{
			Assert.AreNotEqual( new object[] { 1, 2, 3 }, new object[] { 1, 3, 2 } );
		}

6. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test]
		public void ArraysNotEqual()
		{
			Assert.AreNotEqual( new object[] { 1, 2, 3 }, new object[] { 1, 3, 2 } );
		}

7. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test, ExpectedException( typeof( AssertionException ) )]
		public void ArraysNotEqualFails()
		{
			expectedMessage =
				"  Expected: not < 1, 2, 3 >" + Environment.NewLine +
				"  But was:  < 1, 2, 3 >" + Environment.NewLine;
			Assert.AreNotEqual( new object[] { 1, 2, 3 }, new object[] { 1, 2, 3 } );
		}

8. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test]
		public void NullNotEqualToNonNull()
		{
			Assert.AreNotEqual( null, 3 );
		}

9. Example

Project: ContinuousTests
Source File: TestTreeTests.cs
View license
[Test]
		public void NonMatchingTreesAreNotEqual()
		{
			Assert.AreNotEqual( tree1, tree4 ); 
			Assert.AreNotEqual( tree2, tree4 ); 
			Assert.AreNotEqual( tree3, tree4 ); 
		}

10. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test, ExpectedException( typeof( AssertionException ) )]
		public void NullEqualsNull()
		{
			expectedMessage =
				"  Expected: not null" + Environment.NewLine +
				"  But was:  null" + Environment.NewLine;
			Assert.AreNotEqual( null, null );
		}

11. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test]
		public void ArraysNotEqual()
		{
			Assert.AreNotEqual( new object[] { 1, 2, 3 }, new object[] { 1, 3, 2 } );
		}

12. Example

Project: ContinuousTests
Source File: TestIDTests.cs
View license
[Test]
		public void DifferentTestIDsDisplayDifferentStrings()
		{
			TestID testID1 = new TestID();
			TestID testID2 = new TestID();
			Assert.AreNotEqual( testID1.ToString(), testID2.ToString() );
		}

13. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test]
		public void NullNotEqualToNonNull()
		{
			Assert.AreNotEqual( null, 3 );
		}

14. Example

Project: ContinuousTests
Source File: TestIDTests.cs
View license
[Test]
		public void DifferentTestIDsDisplayDifferentStrings()
		{
			TestID testID1 = new TestID();
			TestID testID2 = new TestID();
			Assert.AreNotEqual( testID1.ToString(), testID2.ToString() );
		}

15. Example

View license
[Test]
        public void NameIsUnique()
        {
            ProjectDocument anotherProject = new ProjectDocument(xmlfile);
            Assert.AreNotEqual(doc.Name, anotherProject.Name);
        }

16. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test]
		public void NullNotEqualToNonNull()
		{
			Assert.AreNotEqual( null, 3 );
		}

17. Example

Project: ContinuousTests
Source File: NotEqualFixture.cs
View license
[Test, ExpectedException( typeof( AssertionException ) )]
		public void ArraysNotEqualFails()
		{
			expectedMessage =
				"  Expected: not < 1, 2, 3 >" + Environment.NewLine +
				"  But was:  < 1, 2, 3 >" + Environment.NewLine;
			Assert.AreNotEqual( new object[] { 1, 2, 3 }, new object[] { 1, 2, 3 } );
		}

18. Example

Project: ContinuousTests
Source File: TestIDTests.cs
View license
[Test]
		public void DifferentTestIDsDisplayDifferentStrings()
		{
			TestID testID1 = new TestID();
			TestID testID2 = new TestID();
			Assert.AreNotEqual( testID1.ToString(), testID2.ToString() );
		}

19. Example

Project: Colore
Source File: ResultTests.cs
View license
[Test]
        public void ShouldNotEqualDifferentInt()
        {
            Assert.AreNotEqual(new Result(0), 1);
        }

20. Example

View license
[Test]
        public void Test_GetRandom()
        {
            var array1 = new List<char> { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p' };
            var random1 = array1.GetRandom();
            var random2 = array1.GetRandom();

            //note strong chance of collisions...
            Assert.AreNotEqual(random1, random2);
        }

21. Example

View license
[Test]
        public void Test_Status_ErrorQuery()
        {
            var stream = ResourceHelper.ReadResourceAsStream("Data\\errors_and_warnings.json");
            var response = new StreamingQueryResult<Beer>
            {
                ResponseStream = stream
            };

            Assert.AreNotEqual(QueryStatus.Success, response.Status);
        }

22. Example

View license
[Test]
        public void Test_GetCombinedHashcode_Jagged_Arrays_Are_NotEqual()
        {
            int[][] array1 = { new[] { 1, -1 }, new[] { 1, -1 }, new[] { 1, -1 } };
            int[][] array2 = { new[] { -1, -1 }, new[] { 1, -1 }, new[] { -1, -1 } };
            Assert.AreNotEqual(array1.GetCombinedHashcode(), array2.GetCombinedHashcode());
        }

23. Example

View license
[Test]
        public void Test_GetCombinedHashcode_Jagged_Arrays_Are_NotEqual()
        {
            int[][] array1 = { new[] { 1, -1 }, new[] { 1, -1 }, new[] { 1, -1 } };
            int[][] array2 = { new[] { -1, -1 }, new[] { 1, -1 }, new[] { -1, -1 } };
            Assert.AreNotEqual(array1.GetCombinedHashcode(), array2.GetCombinedHashcode());
        }

24. Example

View license
[Test]
        public void Test_GetRandom()
        {
            var savedRandom = ArrayExtensions.Random;
            try
            {
                // Use a random number generator with a known seed for consistency
                ArrayExtensions.Random = new Random(500);

                var array1 = new List<char> { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p' };
                var random1 = array1.GetRandom();
                var random2 = array1.GetRandom();

                Assert.AreNotEqual(random1, random2);
            }
            finally
            {
                ArrayExtensions.Random = savedRandom;
            }
        }

25. Example

View license
[Test]
        public void Test_GetCombinedHashcode_Arrays_Are_NotEqual()
        {
            var array1 = new[] {1, 2, 3};
            var array2 = new[] {2, 3, 4};
            Assert.AreNotEqual(array1.GetCombinedHashcode(), array2.GetCombinedHashcode());
        }

26. Example

View license
[Test]
        public void Test_GetCombinedHashcode_Arrays_Are_NotEqual()
        {
            var array1 = new[] {1, 2, 3};
            var array2 = new[] {2, 3, 4};
            Assert.AreNotEqual(array1.GetCombinedHashcode(), array2.GetCombinedHashcode());
        }

27. Example

Project: MonoGame.Extended
Source File: ColourTests.cs
View license
[Test]

            public void WhenObjectsAreDifferent_YieldsDifferentHashCodes()
            {
                var x = new HslColor(0f, 1f, 0f);
                var y = new HslColor(360f, 1f, 1f);
                Assert.AreNotEqual(x.GetHashCode(), y.GetHashCode());
            }

28. Example

Project: CSMSL
Source File: ChemicalFormulaTestFixture.cs
View license
[Test]
        public void FormulaValueInequalityHeavyIsotope()
        {
            ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
            ChemicalFormula formulaB = new ChemicalFormula("CC{13}H3NO");

            Assert.AreNotEqual(formulaA, formulaB);
        }

29. Example

Project: CSMSL
Source File: PeptideTestFixture.cs
View license
[Test]
        public void PeptideInEqualityAminoAcidModification()
        {
            Peptide pepA = new Peptide("DEREK");
            Peptide pepB = new Peptide("DEREK");
            pepB.SetModification(new ChemicalFormula("H2O"), 'R');

            Assert.AreNotEqual(pepA, pepB);
        }

30. Example

Project: CSMSL
Source File: MassTestFixture.cs
View license
[Test]
        public void MassMonoisotopicInequality()
        {
            Mass m1 = new Mass(524.342);
            Mass m2 = new Mass(524.343);

            Assert.AreNotEqual(m1, m2);
        }

31. Example

Project: CSMSL
Source File: ChemicalFormulaTestFixture.cs
View license
[Test]
        public void FormulaValueInequalityNullFormula()
        {
            ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");

            Assert.AreNotEqual(NullChemicalFormula, formulaA);
        }

32. Example

Project: CSMSL
Source File: ChemicalFormulaTestFixture.cs
View license
[Test]
        public void NullFormulaDoesNotEqualFormula()
        {
            ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");

            Assert.AreNotEqual(formulaA, NullChemicalFormula);
        }

33. Example

Project: CSMSL
Source File: ChemicalFormulaTestFixture.cs
View license
[Test]
        public void FormulaValueInequality()
        {
            ChemicalFormula formulaA = new ChemicalFormula("C2H3NO");
            ChemicalFormula formulaB = new ChemicalFormula("NC1OH3");

            Assert.AreNotEqual(formulaA, formulaB);
        }

34. Example

Project: CSMSL
Source File: PeptideTestFixture.cs
View license
[Test]
        public void PeptideInEqualityAminoAcidSwitch()
        {
            Peptide pepA = new Peptide("DEREK");
            Peptide pepB = new Peptide("DEERK");
            Assert.AreNotEqual(pepA, pepB);
        }

35. Example

Project: CSMSL
Source File: MassTestFixture.cs
View license
[Test]
        public void MassBothInequality()
        {
            Mass m1 = new Mass(524.342);
            Mass m2 = new Mass(524.343);

            Assert.AreNotEqual(m1, m2);
        }

36. Example

View license
protected void MyPropertyChanging(string newValue) {
                Assert.AreNotEqual(newValue, PropertyChanging);
                PropertyChangingNewValue = newValue;
            }

37. Example

View license
public static TInput AreNotEqual<TInput>(this TInput obj, object expectedValue) {
            Assert.AreNotEqual(expectedValue, obj);
            return obj;
        }

38. Example

View license
protected void OnProperty1Changing(string newValue) {
                Assert.AreNotEqual(newValue, Property1);
                Property1NewValue = newValue;
            }

39. Example

View license
[Test]
        public void UseRealEntryAssemblyTest() {
            var savedEntryAssembly = AssemblyHelper.EntryAssembly;
            AssemblyHelper.EntryAssembly = typeof(int).Assembly;
            try {
                Assert.AreNotEqual(NativeResourceManager.EntryAssembly, AssemblyHelper.EntryAssembly);
            } finally {
                AssemblyHelper.EntryAssembly = savedEntryAssembly;
            }
        }

40. Example

View license
protected override void OnProtectedChangedMethodWithParamChanged(string oldValue) {
                Assert.AreNotEqual(ProtectedChangedMethodWithParam, ProtectedChangedMethodWithParamOldValue);
                OnProtectedChangedMethodWithParamChangedCalled = true;
                ProtectedChangedMethodWithParamOldValue = oldValue;
            }

41. Example

Project: HareDu
Source File: VirtualHostTests.cs
View license
[Test, Category("Integration"), Explicit]
        [ExpectedException(typeof (ArgumentNullException))]
        public void Verify_Throw_Exception_When_Virtual_Host_Missing()
        {
            var request = Client
                .Factory<VirtualHostResources>(
                    x => x.Credentials(Settings.Default.LoginUsername, Settings.Default.LoginPassword))
                .Delete(x => x.VirtualHost(string.Empty))
                .Response();
            Assert.AreNotEqual(HttpStatusCode.NoContent, request.StatusCode);
        }

42. Example

Project: OrigoDB
Source File: ProxyTest.cs
View license
[Test]
        public void QueryResultsAreCloned()
        {
            _proxy.AddCustomer("Robert");
            Customer robert = _proxy.GetCustomers().First();
            Customer robert2 = _proxy.GetCustomers().First();
            Assert.AreNotEqual(robert, robert2);
        }

43. Example

View license
[Test]
        public void EncryptData_Should_Return_Encrypted_String()
        {
            var message = "Hello world!";
            var encryptionKey = Config.GetDecryptionkey();
            //Arrange

            //Act
            var encryptedValue = _provider.EncryptParameter(message, encryptionKey);

            //Assert
            Assert.AreNotEqual(message, encryptedValue);
        }

44. Example

View license
[Test]
        public void EncryptData_Should_Return_Encrypted_String()
        {
            var message = "Hello world!";
            var encryptionKey = Config.GetDecryptionkey();
            //Arrange

            //Act
            var encryptedValue = _provider.EncryptParameter(message, encryptionKey);

            //Assert
            Assert.AreNotEqual(message, encryptedValue);
        }

45. Example

Project: Dnn.Platform
Source File: FluentMapperTests.cs
View license
[Test]
        public void FluentMapper_Does_Not_Set_PrimaryKey_To_Attribute()
        {
            //Arrange
            var mapper = new FluentMapper<Person>(String.Empty);
            mapper.PrimaryKey(Constants.TABLENAME_Key);

            //Act
            var ti = mapper.GetTableInfo(typeof(Person));

            //Assert
            Assert.AreNotEqual(Constants.TABLENAME_Person_Key, ti.PrimaryKey);
        }

46. Example

Project: NPOI
Source File: TestSmallBlockTableReader.cs
View license
[Test]
        public void TestReadingConstructor()
        {
            string[] rawDataArray = {
/n ..... /n //View Source file for more details /n }

47. Example

Project: DotSpatial
Source File: Size2DTests.cs
View license
[Test(Description = "Checks whether Size2Ds != operator works correctly.")]
        [TestCaseSource(nameof(EqualityOperatorWorksTestCases))]
        public void UnEqualityOperatorWorks(Size2D size1, Size2D size2, bool unExpectedResult)
        {
            Assert.AreNotEqual(unExpectedResult, size1 != size2); // unequality can use the same cases as equality, but should return not equal
        }

48. Example

Project: Winium.Cruciatus
Source File: CheckSecondTab.cs
View license
[Test]
        public void CheckingTextBox2()
        {
            this.secondTab.TextBox2.SetText("start test text");
            var startText = this.secondTab.TextBox2.Text();

            this.secondTab.TextBox2.SetText("new test text");
            var currentText = this.secondTab.TextBox2.Text();

            Assert.AreNotEqual(startText, currentText, "????? ?? ?????????.");
        }

49. Example

Project: Winium.Cruciatus
Source File: CheckSecondTab.cs
View license
[Test]
        public void CheckingTextBox2()
        {
            if (!this.secondTab.TextBox2.Properties.IsEnabled)
            {
                this.secondTab.ChangeEnabledButton.Click();
            }

            var startText = this.secondTab.TextBox2.Text();

            this.secondTab.TextBox2.SetText("new test text");

            var currentText = this.secondTab.TextBox2.Text();

            Assert.AreNotEqual(startText, currentText, "????? ?? ?????????.");
        }

50. Example

Project: Winium.Cruciatus
Source File: CheckSecondTab.cs
View license
[Test]
        public void CheckingChangeEnabledTextBox2()
        {
            var isEnabled = this.secondTab.TextBox2.Properties.IsEnabled;

            this.secondTab.ChangeEnabledButton.Click();

            Assert.AreNotEqual(
                isEnabled, 
                this.secondTab.TextBox2.Properties.IsEnabled, 
                "???????????? TextBox2 ?? ??????????.");
        }