NUnit.Framework.Assert.AreEqual(object, object, string)

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

200 Examples 7

1. Example

View license
[Test]
            public void InheritedRussian()
            {
                Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
                Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
            }

2. Example

View license
[Test, SetCulture("fr-FR"), SetUICulture("fr-CA")]
        public void SetMixedCulturesToFrenchAndUIFrenchCanadian()
        {
            Assert.AreEqual("fr-FR", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

3. Example

View license
[Test, SetCulture("fr-FR"), SetUICulture("fr-CA")]
        public void SetMixedCulturesToFrenchAndUIFrenchCanadian()
        {
            Assert.AreEqual("fr-FR", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

4. Example

Project: ContinuousTests
Source File: CSharpTest.cs
View license
[Test] public void Add() 
		{
			double result= fValue1 + fValue2;
			// forced failure result == 5
			Assert.AreEqual(6, result, "Expected Failure.");
		}

5. Example

View license
[Test, SetUICulture("fr-FR")]
            public void InheritedRussianWithUIFrench()
            {
                Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
                Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
            }

6. Example

Project: ContinuousTests
Source File: CSharpTest.cs
View license
[Test] public void Add() 
		{
			double result= fValue1 + fValue2;
			// forced failure result == 5
			Assert.AreEqual(6, result, "Expected Failure.");
		}

7. Example

View license
[Test, SetUICulture("ru-RU")]
        public void SetUICultureOnlyToRussian()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

8. Example

View license
[Test, SetUICulture("fr-FR")]
        public void SetUICultureOnlyToFrench()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

9. Example

View license
[Test, SetCulture("ru-RU"), SetUICulture("en-US")]
        public void SetMixedCulturesToRussianAndUIEnglishUS()
        {
            Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("en-US", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

10. Example

View license
[Test, SetCulture("fr-CA"), SetUICulture("fr-CA")]
        public void SetBothCulturesToFrenchCanadian()
        {
            Assert.AreEqual("fr-CA", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

11. Example

View license
[Test]
            public void InheritedRussian()
            {
                Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
                Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
            }

12. Example

View license
[Test, SetUICulture("fr-FR")]
        public void SetUICultureOnlyToFrench()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

13. Example

View license
[Test]
            public void InheritedRussian()
            {
                Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
                Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
            }

14. Example

View license
[Test, SetCulture("fr-FR"), SetUICulture("fr-CA")]
        public void SetMixedCulturesToFrenchAndUIFrenchCanadian()
        {
            Assert.AreEqual("fr-FR", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

15. Example

Project: ContinuousTests
Source File: CSharpTest.cs
View license
[Test] public void Add() 
		{
			double result= fValue1 + fValue2;
			// forced failure result == 5
			Assert.AreEqual(6, result, "Expected Failure.");
		}

16. Example

View license
[Test, SetCulture("fr-FR"), SetUICulture("fr-FR")]
        public void SetBothCulturesToFrench()
        {
            Assert.AreEqual("fr-FR", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

17. Example

Project: ContinuousTests
Source File: CSharpTest.cs
View license
[Test] public void Add() 
		{
			double result= fValue1 + fValue2;
			// forced failure result == 5
			Assert.AreEqual(6, result, "Expected Failure.");
		}

18. Example

View license
[Test, SetUICulture("fr-FR")]
            public void InheritedRussianWithUIFrench()
            {
                Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
                Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
            }

19. Example

View license
[Test, SetUICulture("fr-CA")]
        public void SetUICultureOnlyToFrenchCanadian()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

20. Example

View license
[Test, SetUICulture("fr-FR")]
        public void SetUICultureOnlyToFrench()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

21. Example

View license
[Test, SetUICulture("ru-RU")]
        public void SetUICultureOnlyToRussian()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

22. Example

View license
[Test, SetUICulture("ru-RU")]
        public void SetUICultureOnlyToRussian()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

23. Example

View license
[Test, SetCulture("ru-RU"), SetUICulture("en-US")]
        public void SetMixedCulturesToRussianAndUIEnglishUS()
        {
            Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("en-US", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

24. Example

View license
[Test, SetUICulture("fr-CA")]
        public void SetUICultureOnlyToFrenchCanadian()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

25. Example

View license
[Test, SetCulture("ru-RU"), SetUICulture("ru-RU")]
        public void SetBothCulturesToRussian()
        {
            Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

26. Example

View license
[Test, SetCulture("fr-CA"), SetUICulture("fr-CA")]
        public void SetBothCulturesToFrenchCanadian()
        {
            Assert.AreEqual("fr-CA", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

27. Example

View license
[Test, SetCulture("ru-RU"), SetUICulture("en-US")]
        public void SetMixedCulturesToRussianAndUIEnglishUS()
        {
            Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("en-US", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

28. Example

View license
[Test, SetUICulture("fr-FR")]
            public void InheritedRussianWithUIFrench()
            {
                Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
                Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
            }

29. Example

View license
[Test, SetUICulture("fr-CA")]
        public void SetUICultureOnlyToFrenchCanadian()
        {
            Assert.AreEqual(CultureInfo.CurrentCulture, originalCulture, "Culture should not change");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

30. Example

View license
[Test, SetCulture("fr-FR"), SetUICulture("fr-FR")]
        public void SetBothCulturesToFrench()
        {
            Assert.AreEqual("fr-FR", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

31. Example

View license
[Test, SetCulture("fr-FR"), SetUICulture("fr-FR")]
        public void SetBothCulturesToFrench()
        {
            Assert.AreEqual("fr-FR", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-FR", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

32. Example

Project: ContinuousTests
Source File: CSharpTest.cs
View license
[Test] public void Add() 
		{
			double result= fValue1 + fValue2;
			// forced failure result == 5
			Assert.AreEqual(6, result, "Expected Failure.");
		}

33. Example

View license
[Test, SetCulture("ru-RU"), SetUICulture("ru-RU")]
        public void SetBothCulturesToRussian()
        {
            Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

34. Example

View license
[Test, SetCulture("ru-RU"), SetUICulture("ru-RU")]
        public void SetBothCulturesToRussian()
        {
            Assert.AreEqual("ru-RU", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("ru-RU", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

35. Example

View license
[Test, SetCulture("fr-CA"), SetUICulture("fr-CA")]
        public void SetBothCulturesToFrenchCanadian()
        {
            Assert.AreEqual("fr-CA", CultureInfo.CurrentCulture.Name, "Culture not set correctly");
            Assert.AreEqual("fr-CA", CultureInfo.CurrentUICulture.Name, "UICulture not set correctly");
        }

36. Example

Project: Portable.Xaml
Source File: ReferenceTest.cs
View license
public object GetService (Type serviceType)
			{
				Assert.AreEqual (typeof (IXamlNameResolver), serviceType, "TypeToResolve");
				return resolver;
			}

37. Example

View license
[Test]
        public void ConstructedWithTypeName()
        {
            var vsa = new ValueSerializerAttribute(TestTypeTypeName);
            Assert.AreEqual(typeof(TestType).AssemblyQualifiedName, vsa.ValueSerializerTypeName, "#1");
            Assert.AreEqual(typeof(TestType), vsa.ValueSerializerType, "#1");
        }

38. Example

Project: Portable.Xaml
Source File: XamlDeferLoadTest.cs
View license
[Test]
		public void TypeShouldReturnName()
		{
			var attr = new XamlDeferLoadAttribute(typeof(TestDeferredLoader), typeof(DeferredLoadingChild));
			Assert.AreEqual(typeof(TestDeferredLoader).AssemblyQualifiedName, attr.LoaderTypeName, "#1");
			Assert.AreEqual(typeof(DeferredLoadingChild).AssemblyQualifiedName, attr.ContentTypeName, "#2");
		}

39. Example

View license
[Test]
		public void SettingsNull()
		{
			// allowed.
			var w = new XamlObjectWriter(sctx, null);
			Assert.AreEqual(sctx, w.SchemaContext, "#1");
		}

40. Example

View license
[Test]
        public void ConstructedWithType()
        {
            var vsa = new ValueSerializerAttribute(typeof(TestType));
            Assert.AreEqual(typeof(TestType), vsa.ValueSerializerType, "#1");
            Assert.AreEqual(typeof(TestType).AssemblyQualifiedName, vsa.ValueSerializerTypeName, "#2");
        }

41. Example

Project: Portable.Xaml
Source File: TypeExtensionTest.cs
View license
public object GetService (Type serviceType)
			{
				Assert.AreEqual (typeof (IXamlTypeResolver), serviceType, "TypeToResolve");
				return works ? this : null;
			}

42. Example

Project: OrigoDB
Source File: BitsetTests.cs
View license
[Test]
        public void SetBitReturnsPreviousValue()
        {
            bool actual = _target.SetBit("a", 42, true);
            Assert.AreEqual(false, actual, "should return false on initial call to set");

            actual = _target.SetBit("a", 42, false);
            Assert.AreEqual(true, actual, "expected true as set in the previous call");

            actual = _target.SetBit("a", 42, true);
            Assert.AreEqual(false, actual, "false returned when previously set ");
        }

43. Example

Project: Dnn.Platform
Source File: HttpSimulatorTests.cs
View license
public void CanGetSetSession()
		{
			using (new HttpSimulator("/", @"c:\inetpub\").SimulateRequest())
			{
				HttpContext.Current.Session["Test"] = "Success";
				Assert.AreEqual("Success", HttpContext.Current.Session["Test"], "Was not able to retrieve session variable.");
			}
		}

44. Example

Project: Dnn.Platform
Source File: HttpSimulatorTests.cs
View license
public void CanGetSetApplicationVariables()
		{
			using (new HttpSimulator("/", @"c:\inetpub\").SimulateRequest())
			{
				HttpContext.Current.Application["Test"] = "Success";
				Assert.AreEqual("Success", HttpContext.Current.Application["Test"], "Was not able to retrieve application variable.");
			}
		}

45. Example

Project: api
Source File: Assert.cs
View license
public static void AreEqual(object expected, object actual)
	    {
            AreEqual(expected, actual, string.Empty);
	    }

46. Example

Project: NPOI
Source File: TestAreaPtg.cs
View license
private void validateReference(bool abs, AreaPtg ref1)
        {
            Assert.AreEqual(abs, !ref1.IsFirstColRelative, "First column reference is not " + (abs ? "absolute" : "relative"));
            Assert.AreEqual(abs, !ref1.IsLastColRelative, "Last column reference is not " + (abs ? "absolute" : "relative"));
            Assert.AreEqual(abs, !ref1.IsFirstRowRelative, "First row reference is not " + (abs ? "absolute" : "relative"));
            Assert.AreEqual(abs, !ref1.IsLastRowRelative, "Last row reference is not " + (abs ? "absolute" : "relative"));
        }

47. Example

Project: NPOI
Source File: TestCellRange.cs
View license
[Test]
        public void TestContainsMethod()
        {
            CellRangeAddress[] ranges = sampleRanges;
            for (int i = 0; i != ranges.Length; i++)
            {
                for (int j = 0; j != ranges.Length; j++)
                {
                    bool expectedResult = containsExpectedResults[i, j];
                    Assert.AreEqual(expectedResult, CellRangeUtil.Contains(ranges[i], ranges[j]), "(" + i + "," + j + "): ");
                }
            }
        }

48. Example

Project: NPOI
Source File: TestStatsLib.cs
View license
[Test]
        public void TestKthLargest()
        {
            double[] v = null;
            double d, x = 0;

            v = new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            d = StatsLib.kthLargest(v, 3);
            x = 8;
            Assert.AreEqual( x, d,"kthLargest ");

            v = new double[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
            d = StatsLib.kthLargest(v, 3);
            x = 1;
            Assert.AreEqual( x, d,"kthLargest ");

            v = new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            d = StatsLib.kthLargest(v, 3);
            x = 0;
            Assert.AreEqual( x, d,"kthLargest ");

            v = new double[] { 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 };
            d = StatsLib.kthLargest(v, 3);
            x = 2;
            Assert.AreEqual( x, d,"kthLargest ");

            v = new double[] { 123.12, 33.3333, 2d / 3d, 5.37828, 0.999 };
            d = StatsLib.kthLargest(v, 3);
            x = 5.37828;
            Assert.AreEqual( x, d,"kthLargest ");

            v = new double[] { -1, -2, -3, -4, -5, -6, -7, -8, -9, -10 };
            d = StatsLib.kthLargest(v, 3);
            x = -3;
            Assert.AreEqual( x, d,"kthLargest ");
        }

49. Example

Project: NPOI
Source File: TestFinanceLib.cs
View license
[Test]
        public void TestPmt()
        {
            double f, r, y, p, x;
            int n;
            bool t = false;

            r = 0; n = 3; p = 2; f = 7; t = true;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = -3;
            Assert.AreEqual(x, y, "pmt ");

            // cross check with pv
            r = 1; n = 10; p = -109.66796875; f = 10000; t = false;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = 100;
            Assert.AreEqual(x, y, "pmt ");

            r = 1; n = 10; p = -209.5703125; f = 10000; t = true;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = 100;
            Assert.AreEqual(x, y, "pmt ");

            // cross check with fv
            r = 2; n = 12; f = -6409178400d; p = 12000; t = false;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = 120;
            Assert.AreEqual(x, y, "pmt ");

            r = 2; n = 12; f = -6472951200d; p = 12000; t = true;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = 120;
            Assert.AreEqual(x, y, "pmt ");
        }

50. Example

Project: NPOI
Source File: TestHSSFDateUtil.cs
View license
[Ignore("")]
        public void TestCalendarConversion()
        {
            DateTime date = new /n ..... /n //View Source file for more details /n }