当前位置: 首页>>代码示例>>C#>>正文


C# Money.GetHashCode方法代码示例

本文整理汇总了C#中Money.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Money.GetHashCode方法的具体用法?C# Money.GetHashCode怎么用?C# Money.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Money的用法示例。


在下文中一共展示了Money.GetHashCode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Two_money_instances_do_not_equal_if_contain_different_money_amounts

        public void Two_money_instances_do_not_equal_if_contain_different_money_amounts()
        {
            Money dollar = new Money(0, 0, 0, 1, 0, 0);
            Money hundredCents = new Money(100, 0, 0, 0, 0, 0);

            dollar.Should().NotBe(hundredCents);
            dollar.GetHashCode().Should().NotBe(hundredCents.GetHashCode());
        }
开发者ID:DamianReeves,项目名称:DddInPracticeWithEven,代码行数:8,代码来源:MoneySpecs.cs

示例2: Two_money_instances_equal_if_contain_the_same_money_amount

        public void Two_money_instances_equal_if_contain_the_same_money_amount()
        {
            Money money1 = new Money(1, 2, 3, 4, 5, 6);
            Money money2 = new Money(1, 2, 3, 4, 5, 6);

            money1.Should().Be(money2);
            money1.GetHashCode().Should().Be(money2.GetHashCode());
        }
开发者ID:DamianReeves,项目名称:DddInPracticeWithEven,代码行数:8,代码来源:MoneySpecs.cs

示例3: MoneyHash

 public void MoneyHash()
 {
   Assert.IsFalse(f12CHF.Equals(null));
   Money equal = new Money(12, "CHF");
   Assert.AreEqual(f12CHF.GetHashCode(), equal.GetHashCode());
 }
开发者ID:cdromka,项目名称:sonar-csharp,代码行数:6,代码来源:TestMoney.cs

示例4: GetHashCodeTest

 public void GetHashCodeTest()
 {
     Currency currency = new Currency("USD", "USD");
     Money target = new Money(100, currency);
     Money other = new Money(100, currency);
     Assert.AreEqual(target.GetHashCode(), other.GetHashCode());
 }
开发者ID:robukoo,项目名称:SimpleBankingSystem,代码行数:7,代码来源:MoneyTest.cs

示例5: TestMoneyHash

 /// <summary>
 /// 
 /// </summary>
 public void TestMoneyHash()
 {
     Assertion.Assert(!f12CHF.Equals(null));
     Money equal= new Money(12, "CHF");
     Assertion.AssertEquals(f12CHF.GetHashCode(), equal.GetHashCode());
 }
开发者ID:jhare,项目名称:MDNA,代码行数:9,代码来源:MoneyTest.cs

示例6: TestMoneyEquals

 /// <summary>
 /// 
 /// </summary>
 public void TestMoneyEquals()
 {
     Assertion.Assert(!f12CHF.Equals(null));
     Money equalMoney= new Money(12, "CHF");
     Assertion.AssertEquals(f12CHF, f12CHF);
     Assertion.AssertEquals(f12CHF, equalMoney);
     Assertion.AssertEquals(f12CHF.GetHashCode(), equalMoney.GetHashCode());
     Assertion.Assert(!f12CHF.Equals(f14CHF));
 }
开发者ID:jhare,项目名称:MDNA,代码行数:12,代码来源:MoneyTest.cs


注:本文中的Money.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。