NUnit.Framework.Assert.AreEqual(decimal, decimal)

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

101 Examples 7

1. Example

Project: NsqSharp
Source File: ObjectExtensionsTest.cs
View license
[Test]
        public void CoerceSameTypeReturns()
        {
            const decimal expected = 123.456m;
            decimal actual = expected.Coerce<decimal>();

            Assert.AreEqual(expected, actual);
        }

2. Example

Project: nhibernate-core
Source File: SumTests.cs
View license
[Test]
		public async Task EmptySumNullableDecimalAsync()
		{
			decimal total = await (db.Orders.Where(ol => false).SumAsync(ol => ol.Freight)) ?? 0;
			Assert.AreEqual(0, total);
		}

3. Example

Project: nhibernate-core
Source File: SumTests.cs
View license
[Test]
		public void EmptySumNullableDecimal()
		{
			decimal total = db.Orders.Where(ol => false).Sum(ol => ol.Freight) ?? 0;
			Assert.AreEqual(0, total);
		}

4. Example

Project: nhibernate-core
Source File: SumTests.cs
View license
[Test]
		public async Task EmptySumCastNullableDecimalAsync()
		{
			decimal total = await (db.OrderLines.Where(ol => false).SumAsync(ol => (decimal?)ol.Discount)) ?? 0;
			Assert.AreEqual(0, total);
		}

5. Example

Project: nhibernate-core
Source File: SumTests.cs
View license
[Test]
		public void EmptySumCastNullableDecimal()
		{
			decimal total = db.OrderLines.Where(ol => false).Sum(ol => (decimal?)ol.Discount) ?? 0;
			Assert.AreEqual(0, total);
		}

6. Example

Project: cardmaker
Source File: ParseUtilTest.cs
View license
[TestCase("1", 1, Result = true)]
        [TestCase("1.0", 1, Result = true)]
        [TestCase("1,0", 1, Result = true)]
        [TestCase("1.1", 1.1, Result = true)]
        [TestCase("1,1", 1.1, Result = true)]
        [TestCase("123.456", 123.456, Result = true)]
        [TestCase("123,456", 123.456, Result = true)]
        [TestCase("c", 0, Result = false)]
        public bool VerifyDecimalParse(string sInput, decimal dExpectedValue)
        {
            decimal dValue;
            if (!ParseUtil.ParseDecimal(sInput, out dValue))
            {
                return false;
            }
            Assert.AreEqual(dExpectedValue, dValue);
            return true;
        }

7. Example

Project: GlmSharp
Source File: swizzle_decvec2.Test.cs
View license
[Test]
        public void XYZW()
        {
            {
                var ov = new decvec2(0.5m,/n ..... /n //View Source file for more details /n }

8. Example

Project: GlmSharp
Source File: decvec2.Test.cs
View license
[Test]
        public void StaticProperties()
        {
            Assert.AreEqual(0m, decvec2.Zero.x);
            Assert.AreEqual(0m, decvec2.Zero.y);
            
            Assert.AreEqual(1m, decvec2.Ones.x);
            Assert.AreEqual(1m, decvec2.Ones.y);
            
            Assert.AreEqual(1m, decvec2.UnitX.x);
            Assert.AreEqual(0m, decvec2.UnitX.y);
            
            Assert.AreEqual(0m, decvec2.UnitY.x);
            Assert.AreEqual(1m, decvec2.UnitY.y);
            
            Assert.AreEqual(decimal.MaxValue, decvec2.MaxValue.x);
            Assert.AreEqual(decimal.MaxValue, decvec2.MaxValue.y);
            
            Assert.AreEqual(decimal.MinValue, decvec2.MinValue.x);
            Assert.AreEqual(decimal.MinValue, decvec2.MinValue.y);
            
            Assert.AreEqual(decimal.MinusOne, decvec2.MinusOne.x);
            Assert.AreEqual(decimal.MinusOne, decvec2.MinusOne.y);
        }

9. Example

Project: GlmSharp
Source File: decvec3.Test.cs
View license
[Test]
        public void Constructors()
        {
            {
                var v = new decvec3(2m);
                Assert.AreEqual(2m, v.x);
                Assert.AreEqual(2m, v.y);
                Assert.AreEqual(2m, v.z);
            }
            {
                var v = new decvec3(-0.5m, 5m, 0m);
                Assert.AreEqual(-0.5m, v.x);
                Assert.AreEqual(5m, v.y);
                Assert.AreEqual(0m, v.z);
            }
            {
                var v = new decvec3(new decvec2(7m, 6m));
                Assert.AreEqual(7m, v.x);
                Assert.AreEqual(6m, v.y);
                Assert.AreEqual(0m, v.z);
            }
            {
                var v = new decvec3(new decvec3(2.5m, 7.5m, -8m));
                Assert.AreEqual(2.5m, v.x);
                Assert.AreEqual(7.5m, v.y);
                Assert.AreEqual(-8m, v.z);
            }
            {
                var v = new decvec3(new decvec4(-6.5m, 0m, -7.5m, -2.5m));
                Assert.AreEqual(-6.5m, v.x);
                Assert.AreEqual(0m, v.y);
                Assert.AreEqual(-7.5m, v.z);
            }
        }

10. Example

Project: GlmSharp
Source File: swizzle_decvec4.Test.cs
View license
[Test]
        public void RGBA()
        {
            {
                var ov = new decvec4(-0.5m/n ..... /n //View Source file for more details /n }

11. Example

Project: GlmSharp
Source File: decvec2.Test.cs
View license
[Test]
        public void Constructors()
        {
            {
                var v = new decvec2(7.5m);
                Assert.AreEqual(7.5m, v.x);
                Assert.AreEqual(7.5m, v.y);
            }
            {
                var v = new decvec2(9m, -8.5m);
                Assert.AreEqual(9m, v.x);
                Assert.AreEqual(-8.5m, v.y);
            }
            {
                var v = new decvec2(new decvec2(-9.5m, -5m));
                Assert.AreEqual(-9.5m, v.x);
                Assert.AreEqual(-5m, v.y);
            }
            {
                var v = new decvec2(new decvec3(-3.5m, -6m, -3m));
                Assert.AreEqual(-3.5m, v.x);
                Assert.AreEqual(-6m, v.y);
            }
            {
                var v = new decvec2(new decvec4(4.5m, 5m, 8.5m, -8.5m));
                Assert.AreEqual(4.5m, v.x);
                Assert.AreEqual(5m, v.y);
            }
        }

12. Example

Project: GlmSharp
Source File: swizzle_decvec2.Test.cs
View license
[Test]
        public void RGBA()
        {
            {
                var ov = new decvec2(-4m, /n ..... /n //View Source file for more details /n }

13. Example

Project: GlmSharp
Source File: swizzle_decvec3.Test.cs
View license
[Test]
        public void RGBA()
        {
            {
                var ov = new decvec3(-0.5m/n ..... /n //View Source file for more details /n }

14. Example

Project: GlmSharp
Source File: decvec4.Test.cs
View license
[Test]
        public void Constructors()
        {
            {
                var v = new decvec4(-4.5m);
                Assert.AreEqual(-4.5m, v.x);
                Assert.AreEqual(-4.5m, v.y);
                Assert.AreEqual(-4.5m, v.z);
                Assert.AreEqual(-4.5m, v.w);
            }
            {
                var v = new decvec4(7.5m, -7.5m, -3m, 3m);
                Assert.AreEqual(7.5m, v.x);
                Assert.AreEqual(-7.5m, v.y);
                Assert.AreEqual(-3m, v.z);
                Assert.AreEqual(3m, v.w);
            }
            {
                var v = new decvec4(new decvec2(4m, 8m));
                Assert.AreEqual(4m, v.x);
                Assert.AreEqual(8m, v.y);
                Assert.AreEqual(0m, v.z);
                Assert.AreEqual(0m, v.w);
            }
            {
                var v = new decvec4(new decvec3(-4m, -9m, 4.5m));
                Assert.AreEqual(-4m, v.x);
                Assert.AreEqual(-9m, v.y);
                Assert.AreEqual(4.5m, v.z);
                Assert.AreEqual(0m, v.w);
            }
            {
                var v = new decvec4(new decvec4(-8m, -4.5m, -8m, -9.5m));
                Assert.AreEqual(-8m, v.x);
                Assert.AreEqual(-4.5m, v.y);
                Assert.AreEqual(-8m, v.z);
                Assert.AreEqual(-9.5m, v.w);
            }
        }

15. Example

Project: GlmSharp
Source File: swizzle_decvec3.Test.cs
View license
[Test]
        public void XYZW()
        {
            {
                var ov = new decvec3(4m, -/n ..... /n //View Source file for more details /n }

16. Example

Project: GlmSharp
Source File: swizzle_decvec4.Test.cs
View license
[Test]
        public void XYZW()
        {
            {
                var ov = new decvec4(4m, -/n ..... /n //View Source file for more details /n }

17. Example

Project: GlmSharp
Source File: decvec4.Test.cs
View license
[Test]
        public void StaticProperties()
        {
            Assert.AreEqual(0m, decvec4.Zero/n ..... /n //View Source file for more details /n }

18. Example

Project: GlmSharp
Source File: decvec3.Test.cs
View license
[Test]
        public void StaticProperties()
        {
            Assert.AreEqual(0m, decvec3.Zero/n ..... /n //View Source file for more details /n }

19. Example

Project: QPAS
Source File: PositionTest.cs
View license
[Test]
        public void AddOrderReturnsCorrectCurrentCapitalUsageWhenOpeningAPosition()
        {
            var pos = new Position(_instrument);
            var o = new Order
            {
                Quantity = 100,
                Price = 12,
                Instrument = _instrument,
                FXRateToBase = 1
            };
            decimal capUsage = pos.AddOrder(o);

            Assert.AreEqual(1200, capUsage);
        }

20. Example

Project: Json.Net.Unity3D
Source File: JsonConvertTest.cs
View license
[Test]
        public void PopulateObjectWithMultipleHeaderComment()
        {
            string json = @"// file header
// another file header?
{
  ""prop"": 1.0
}";

            PopulateTestObject o = new PopulateTestObject();
            JsonConvert.PopulateObject(json, o);

            Assert.AreEqual(1m, o.Prop);
        }

21. Example

Project: Json.Net.Unity3D
Source File: JsonConvertTest.cs
View license
[Test]
        public void PopulateObjectWithHeaderComment()
        {
            string json = @"// file header
{
  ""prop"": 1.0
}";

            PopulateTestObject o = new PopulateTestObject();
            JsonConvert.PopulateObject(json, o);

            Assert.AreEqual(1m, o.Prop);
        }

22. Example

View license
[Test]
        public void Convert_IntNumber_AppropriateDecimal()
        {
            //arrange
            decimal expected = 346;

            //action
            decimal actual = (decimal)Target.Convert(346, typeof(Decimal), null, null);

            //assert
            Assert.AreEqual(expected, actual);
        }

23. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void Decimal() 
		{
			decimal expected = 100m;
			decimal actual = 100.0m;
			int integer = 100;

			Assert.IsTrue( expected == actual );
			Assert.AreEqual(expected, actual);
			Assert.IsTrue(expected == integer);
			Assert.AreEqual(expected, integer);
			Assert.IsTrue(actual == integer);
			Assert.AreEqual(actual, integer);
		}

24. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void Decimal() 
		{
			decimal expected = 100m;
			decimal actual = 100.0m;
			int integer = 100;

			Assert.IsTrue( expected == actual );
			Assert.AreEqual(expected, actual);
			Assert.IsTrue(expected == integer);
			Assert.AreEqual(expected, integer);
			Assert.IsTrue(actual == integer);
			Assert.AreEqual(actual, integer);
		}

25. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void Decimal() 
		{
			decimal expected = 100m;
			decimal actual = 100.0m;
			int integer = 100;

			Assert.IsTrue( expected == actual );
			Assert.AreEqual(expected, actual);
			Assert.IsTrue(expected == integer);
			Assert.AreEqual(expected, integer);
			Assert.IsTrue(actual == integer);
			Assert.AreEqual(actual, integer);
		}

26. Example

Project: OutlookPrivacyPlugin
Source File: JValueTests.cs
View license
[Test]
        public void ConvertsToDecimal()
        {
            Assert.AreEqual(Decimal.MaxValue, Convert.ToDecimal(new JValue(Decimal.MaxValue)));
        }

27. Example

Project: OutlookPrivacyPlugin
Source File: JValueTests.cs
View license
[Test]
        public void ConvertsToDecimal_Int64()
        {
            Assert.AreEqual(123, Convert.ToDecimal(new JValue(123)));
        }

28. Example

Project: fuckshadows-windows
Source File: UnitTest.cs
View license
[Test]
        public void TestLib_chacha20poly1305()
        {
            byte[] firstkey =
      /n ..... /n //View Source file for more details /n }

29. Example

View license
public void AssertResult(decimal expectedReslt)
        {
            string strResult = GetCalculatorResultText();
            var actualResult = decimal.Parse(strResult);

            Assert.AreEqual(expectedReslt, actualResult);
        }

30. Example

Project: FileHelpers
Source File: DecimalNumbers.cs
View license
private static void CheckDecimal(decimal dec, DecimalType res)
        {
            Assert.AreEqual((decimal) dec, res.DecimalField);
            Assert.AreEqual((double) dec, res.DoubleField);
            Assert.AreEqual((float) dec, res.FloatField);
        }

31. Example

Project: FileHelpers
Source File: CustomConverter3.cs
View license
[Test]
        public void PriceConverterTest()
        {
            var engine = new FileHelperEngine<PriceRecord>();

            PriceRecord[] res = TestCommon.ReadTest<PriceRecord>(engine, "Good", "PriceConverter.txt");

            Assert.AreEqual(4, res.Length);


            Assert.AreEqual(125, res[0].ProductId);
            Assert.AreEqual((decimal) 145.88, res[0].PriceList);
            Assert.AreEqual((decimal) 130.25, res[0].PriceOnePay);

            Assert.AreEqual(126, res[1].ProductId);
            Assert.AreEqual((decimal) 1234.56, res[1].PriceList);
            Assert.AreEqual((decimal) 2345.67, res[1].PriceOnePay);

            Assert.AreEqual(127, res[2].ProductId);
            Assert.AreEqual((decimal) 12345.67, res[2].PriceList);
            Assert.AreEqual((decimal) 23456.78, res[2].PriceOnePay);

            Assert.AreEqual(128, res[3].ProductId);
            Assert.AreEqual((decimal) 8765.43, res[3].PriceList);
            Assert.AreEqual((decimal) 1234.56, res[3].PriceOnePay);
        }

32. Example

View license
[Test]
        public void GetField_FieldContainsValidDecimal_ReturnsDecimal()
        {
            //Assign
            string fieldValue = "3.141592";
            decimal expected = 3.141592M;
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, fieldValue);
            var field = item.Fields[new ID(fieldId)];

            var mapper = new SitecoreFieldDecimalMapper();


            //Act
            var result = (decimal)mapper.GetField(field, null, null);

            //Assert
            Assert.AreEqual(expected, result);
        }

33. Example

View license
public void GetField_FieldContainsEmptyString_ReturnsDecimalZero()
        {
            //Assign
            string fieldValue = string.Empty;
            decimal expected = 0;
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, fieldValue);
            var field = item.Fields[new ID(fieldId)];

            var mapper = new SitecoreFieldDecimalMapper();
            
            //Act
            var result = (decimal)mapper.GetField(field, null, null);

            //Assert
            Assert.AreEqual(expected, result);
        }

34. Example

Project: nunitlite
Source File: EqualsFixture.cs
View license
[Test]
		public void Decimal() 
		{
			decimal expected = 100m;
			decimal actual = 100.0m;
			int integer = 100;

			Assert.IsTrue( expected == actual );
			Assert.AreEqual(expected, actual);
			Assert.IsTrue(expected == integer);
			Assert.AreEqual(expected, integer);
			Assert.IsTrue(actual == integer);
			Assert.AreEqual(actual, integer);
		}

35. Example

Project: nunit
Source File: AssertEqualsTests.cs
View license
[Test]
        public void Decimal() 
        {
            decimal expected = 100m;
            decimal actual = 100.0m;
            int integer = 100;

            Assert.IsTrue( expected == actual );
            Assert.AreEqual(expected, actual);
            Assert.IsTrue(expected == integer);
            Assert.AreEqual(expected, integer);
            Assert.IsTrue(actual == integer);
            Assert.AreEqual(actual, integer);
        }

36. Example

Project: GlmSharp
Source File: decvec4.Test.cs
View license
[Test]
        public void Indexer()
        {
            var v = new decvec4(-5.5m, -9.5m, 7.5m, 6/n ..... /n //View Source file for more details /n }

37. Example

Project: GlmSharp
Source File: swizzle_decvec2.Test.cs
View license
[Test]
        public void InlineRGBA()
        {
            {
                var v0 = new decvec2(7.5m, 9.5m);
                var v1 = -2m;
                var v2 = v0.r;
                v0.r = v1;
                var v3 = v0.r;
            
                Assert.AreEqual(v1, v3);
            
                Assert.AreEqual(-2m, v0.x);
                Assert.AreEqual(9.5m, v0.y);
            
                Assert.AreEqual(7.5m, v2);
            }
            {
                var v0 = new decvec2(-5.5m, -1.5m);
                var v1 = 4.5m;
                var v2 = v0.g;
                v0.g = v1;
                var v3 = v0.g;
            
                Assert.AreEqual(v1, v3);
            
                Assert.AreEqual(-5.5m, v0.x);
                Assert.AreEqual(4.5m, v0.y);
            
                Assert.AreEqual(-1.5m, v2);
            }
            {
                var v0 = new decvec2(-9.5m, -1.5m);
                var v1 = new decvec2(-6.5m, -3.5m);
                var v2 = v0.rg;
                v0.rg = v1;
                var v3 = v0.rg;
            
                Assert.AreEqual(v1, v3);
            
                Assert.AreEqual(-6.5m, v0.x);
                Assert.AreEqual(-3.5m, v0.y);
            
                Assert.AreEqual(-9.5m, v2.x);
                Assert.AreEqual(-1.5m, v2.y);
            }
        }

38. Example

Project: GlmSharp
Source File: swizzle_decvec4.Test.cs
View license
[Test]
        public void InlineXYZW()
        {
            {
                var v0 = new decvec4/n ..... /n //View Source file for more details /n }

39. Example

Project: GlmSharp
Source File: decvec3.Test.cs
View license
[Test]
        public void Indexer()
        {
            var v = new decvec3(-8m, 6.5m, -6m);
    /n ..... /n //View Source file for more details /n }

40. Example

Project: GlmSharp
Source File: swizzle_decvec3.Test.cs
View license
[Test]
        public void InlineRGBA()
        {
            {
                var v0 = new decvec3/n ..... /n //View Source file for more details /n }

41. Example

Project: GlmSharp
Source File: swizzle_decvec4.Test.cs
View license
[Test]
        public void InlineRGBA()
        {
            {
                var v0 = new decvec4/n ..... /n //View Source file for more details /n }

42. Example

Project: GlmSharp
Source File: decvec2.Test.cs
View license
[Test]
        public void Indexer()
        {
            var v = new decvec2(6.5m, 2.5m);
        /n ..... /n //View Source file for more details /n }

43. Example

Project: GlmSharp
Source File: swizzle_decvec3.Test.cs
View license
[Test]
        public void InlineXYZW()
        {
            {
                var v0 = new decvec3/n ..... /n //View Source file for more details /n }

44. Example

Project: GlmSharp
Source File: swizzle_decvec2.Test.cs
View license
[Test]
        public void InlineXYZW()
        {
            {
                var v0 = new decvec2(3m, -3.5m);
                var v1 = new decvec2(-9m, 4.5m);
                var v2 = v0.xy;
                v0.xy = v1;
                var v3 = v0.xy;
            
                Assert.AreEqual(v1, v3);
            
                Assert.AreEqual(-9m, v0.x);
                Assert.AreEqual(4.5m, v0.y);
            
                Assert.AreEqual(3m, v2.x);
                Assert.AreEqual(-3.5m, v2.y);
            }
        }

45. Example

Project: QPAS
Source File: PositionTest.cs
View license
[Test]
        public void CapitalUsageWhenEnteringAndReversingNearCloseIsCounted()
        {
            var pos = new Position(_instrument);
            decimal orderCapitalUsage = 0;
            var o = new Order
            {
                Quantity = 100,
                Price = 10,
                Instrument = _instrument,
                FXRateToBase = 1,
                TradeDate = new DateTime(2000, 1, 1, 15, 59, 0)
            };
            orderCapitalUsage = pos.AddOrder(o);
            Assert.AreEqual(0, orderCapitalUsage);

            var o2 = new Order
            {
                Quantity = -200,
                Price = 10,
                Instrument = _instrument,
                FXRateToBase = 1,
                TradeDate = new DateTime(2000, 1, 1, 15, 59, 1)
            };
            orderCapitalUsage = pos.AddOrder(o2);
            Assert.AreEqual(1000, orderCapitalUsage);

            var o3 = new Order
            {
                Quantity = 100,
                Price = 10,
                Instrument = _instrument,
                FXRateToBase = 1,
                TradeDate = new DateTime(2000, 1, 1, 15, 59, 1)
            };
            orderCapitalUsage = pos.AddOrder(o3);
            Assert.AreEqual(1000, orderCapitalUsage);

            pos.GetPnL(10, 1);

            Assert.AreEqual(2000, pos.Capital.Gross.Last());
            Assert.AreEqual(1000, pos.Capital.Long.Last());
            Assert.AreEqual(1000, pos.Capital.Short.Last());
        }

46. Example

Project: QPAS
Source File: PositionTest.cs
View license
[Test]
        public void CapitalUsageWhenEnteringAndExitingMultipleOrdersNearCloseIsCountedWithSho/n ..... /n //View Source file for more details /n }

47. Example

Project: QPAS
Source File: PositionTest.cs
View license
[Test]
        public void CapitalUsageWhenEnteringAndExitingMultipleOrdersNearCloseIsCounted()
    /n ..... /n //View Source file for more details /n }

48. Example

Project: QPAS
Source File: PositionTest.cs
View license
[Test]
        public void CapitalUsageWhenEnteringAndReversingShortNearCloseIsCounted()
        {
 /n ..... /n //View Source file for more details /n }

49. Example

Project: Json.Net.Unity3D
Source File: JValueTests.cs
View license
[Test]
        public void ConvertsToDecimal_Int64()
        {
            Assert.AreEqual(123, Convert.ToDecimal(new JValue(123)));
        }

50. Example

Project: Json.Net.Unity3D
Source File: JValueTests.cs
View license
[Test]
        public void ConvertsToDecimal()
        {
            Assert.AreEqual(Decimal.MaxValue, Convert.ToDecimal(new JValue(Decimal.MaxValue)));
        }