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


C# Bank.Reduce方法代码示例

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


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

示例1: ReduceSum

 public void ReduceSum()
 {
     IExpression sum = new Sum(Money.Dollar(3), Money.Dollar(4));
     Bank bank = new Bank();
     Money result = bank.Reduce(sum, "USD");
     Assert.Equal(Money.Dollar(7), result);
 }
开发者ID:caspencer,项目名称:TddByExampleWalkThrough,代码行数:7,代码来源:UnitTests.cs

示例2: ReduceMoneyDifferentCurrency

 public void ReduceMoneyDifferentCurrency()
 {
     Bank bank = new Bank();
     bank.AddRate("CHF", "USD", 2);
     Money result = bank.Reduce(Money.Franc(2), "USD");
     Assert.Equal(Money.Dollar(1), result);
 }
开发者ID:caspencer,项目名称:TddByExampleWalkThrough,代码行数:7,代码来源:UnitTests.cs

示例3: Test_Addition_Of_Money

        public void Test_Addition_Of_Money()
        {
            var bank = new Bank();

            ICurrencyExpression sum = Money.Dollar(15).Plus(Money.Dollar(10));
            var reduced = bank.Reduce(sum, "USD");
            Assert.AreEqual(Money.Dollar(25), reduced);
        }
开发者ID:naingyelin,项目名称:TddByExample,代码行数:8,代码来源:Money_Test_Suite.cs

示例4: TestSimpleAddition

 public void TestSimpleAddition()
 {
     var five = Money.Dollar(5);
     ICurrencyExpression sum = five.Plus(five);
     Bank bank = new Bank();
     Money reduced = bank.Reduce(sum, "USD");
     Assert.AreEqual(Money.Dollar(10), reduced);
 }
开发者ID:tgrelecki,项目名称:MultiCurrencyMoney,代码行数:8,代码来源:MultiCurrencyMoneyTests.cs

示例5: Test_Bank_Reduces_Sum

        public void Test_Bank_Reduces_Sum()
        {
            var bank = new Bank();
            var five = Money.Dollar(5);
            ICurrencyExpression sum = five.Plus(five);
            Money reduced = bank.Reduce(sum, "USD");

            Assert.AreEqual(Money.Dollar(10), reduced);
        }
开发者ID:naingyelin,项目名称:TddByExample,代码行数:9,代码来源:Money_Test_Suite.cs

示例6: MixedAddition

 public void MixedAddition()
 {
     IExpression fiveBucks = Money.Dollar(5);
     IExpression tenFrancs = Money.Franc(10);
     Bank bank = new Bank();
     bank.AddRate("CHF", "USD", 2);
     Money result = bank.Reduce(fiveBucks.Plus(tenFrancs), "USD");
     Assert.Equal(Money.Dollar(10), result);
 }
开发者ID:caspencer,项目名称:TddByExampleWalkThrough,代码行数:9,代码来源:UnitTests.cs

示例7: testMixedAddition

 public void testMixedAddition()
 {
     IExpression fiveBucks = Money.dollar(5);
     IExpression tenFrancs = Money.franc(10);
     Bank bank = new Bank();
     bank.AddRate("CHF", "USD", 2);
     Money result = bank.Reduce(fiveBucks.Plus(tenFrancs), "USD");
     Assert.AreEqual(result, Money.dollar(10));
 }
开发者ID:ruprict,项目名称:tddbyexamplec-,代码行数:9,代码来源:DollarTest.cs

示例8: Test_Reduce_Money_Different_Currency

        public void Test_Reduce_Money_Different_Currency()
        {
            Money tenFranc = Money.Franc(10);
            Bank bank = new Bank();

            bank.AddRate("CHF", "USD", 2);

            Money result = bank.Reduce(tenFranc, "USD");

            Assert.AreEqual(Money.Dollar(5), result);
        }
开发者ID:naingyelin,项目名称:TddByExample,代码行数:11,代码来源:Money_Test_Suite.cs

示例9: Test_Reduce_Money

 public void Test_Reduce_Money()
 {
     Bank bank = new Bank();
     Money result = bank.Reduce(Money.Dollar(2), "USD");
     Assert.AreEqual(Money.Dollar(2), result);
 }
开发者ID:naingyelin,项目名称:TddByExample,代码行数:6,代码来源:Money_Test_Suite.cs

示例10: SumPlusMoney

 public void SumPlusMoney()
 {
     IExpression fiveBucks = Money.Dollar(5);
     IExpression tenFrancs = Money.Franc(10);
     Bank bank = new Bank();
     bank.AddRate("CHF", "USD", 2);
     IExpression sum = new Sum(fiveBucks, tenFrancs).Plus(fiveBucks);
     Money result = bank.Reduce(sum, "USD");
     Assert.Equal(Money.Dollar(15), result);
 }
开发者ID:caspencer,项目名称:TddByExampleWalkThrough,代码行数:10,代码来源:UnitTests.cs

示例11: SimpleAddition

 public void SimpleAddition()
 {
     Money five = Money.Dollar(5);
     IExpression sum = five.Plus(five);
     Bank bank = new Bank();
     Money reduced = bank.Reduce(sum, "USD");
     Assert.Equal(Money.Dollar(10), reduced);
 }
开发者ID:caspencer,项目名称:TddByExampleWalkThrough,代码行数:8,代码来源:UnitTests.cs

示例12: ReduceMoney

 public void ReduceMoney()
 {
     Bank bank = new Bank();
     Money result = bank.Reduce(Money.Dollar(1), "USD");
     Assert.Equal(Money.Dollar(1), result);
 }
开发者ID:caspencer,项目名称:TddByExampleWalkThrough,代码行数:6,代码来源:UnitTests.cs

示例13: testSimpleAddition

        public void testSimpleAddition()
        {
            Money five = Money.dollar(5);
            IExpression sum = five.Plus(five);
            Bank bank = new Bank();
            Money reduced = bank.Reduce(sum, "USD");

            Assert.AreEqual(reduced, Money.dollar(10));
        }
开发者ID:ruprict,项目名称:tddbyexamplec-,代码行数:9,代码来源:DollarTest.cs

示例14: testSumTimes

 public void testSumTimes()
 {
     IExpression fiveBucks = Money.dollar(5);
     IExpression tenFrances = Money.franc(10);
     Bank bank = new Bank();
     bank.AddRate("CHF", "USD", 2);
     IExpression sum = new Sum(fiveBucks, tenFrances).Times(2);
     Money result = bank.Reduce(sum, "USD");
     Assert.AreEqual(Money.dollar(20), result);
 }
开发者ID:ruprict,项目名称:tddbyexamplec-,代码行数:10,代码来源:DollarTest.cs


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