~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to addins/RowTest/NUnitExtension.RowTest.Sample/VatCalculatorTest.cs

  • Committer: charliepoole
  • Date: 2008-05-05 22:17:22 UTC
  • Revision ID: vcs-imports@canonical.com-20080505221722-7bdjujqed8pk6al3
Add back RowTestExtension as a separately compiled assembly, bundled
with NUnit, and modify build script to handle addins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// *********************************************************************
 
2
// Copyright 2007, Andreas Schlapsi
 
3
// This is free software licensed under the MIT license. 
 
4
// *********************************************************************
 
5
using System;
 
6
using NUnit.Framework;
 
7
using NUnit.Framework.SyntaxHelpers;
 
8
using NUnitExtension.RowTest;
 
9
using NUnitExtension.RowTest.Sample.VatCalculatorApp;
 
10
 
 
11
namespace NUnitExtension.RowTest.Sample
 
12
{
 
13
        [TestFixture]
 
14
        public class VatCalculatorTest
 
15
        {
 
16
                [RowTest]
 
17
                [Row(100, VatCategoryType.CategoryA, 20)]
 
18
                [Row(100, VatCategoryType.CategoryB, 15)]
 
19
                [Row(100, VatCategoryType.CategoryC, 10)]
 
20
                [Row(150, VatCategoryType.CategoryA, 30)]
 
21
                [Row(200, VatCategoryType.CategoryB, 30)]
 
22
                [Row(150, VatCategoryType.CategoryC, 15)]
 
23
                public void CalculateVat(int amount, VatCategoryType categoryType, int expectedResult)
 
24
                {
 
25
                        VatCalculator calculator = new VatCalculator();
 
26
                        
 
27
                        decimal result = calculator.CalculateVat((decimal)amount, categoryType);
 
28
                        
 
29
                        Assert.That(result, Is.EqualTo((decimal)expectedResult));
 
30
                }
 
31
        }
 
32
}