Last active
December 19, 2017 10:58
-
-
Save litichevskiydv/6ddfa430ca2ca3eaf3c7a44f1d22758c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CalculatorOfExpensesForDesignerWorkTests | |
{ | |
private readonly CalculatorOfExpensesForDesignerWork _calculator; | |
[UsedImplicitly] | |
public static readonly IEnumerable<object[]> TestsData; | |
static CalculatorOfExpensesForDesignerWorkTests() | |
{ | |
TestsData = | |
new[] | |
{ | |
new object[] | |
{ | |
new PrintOrder( | |
EditionType.Collection, | |
CoverType.Hard, | |
PageSize.Quarto, | |
PaperType.Inkjet, | |
new Illustration[0], | |
14, | |
100 | |
), | |
300d | |
}, | |
new object[] | |
{ | |
new PrintOrder( | |
EditionType.Collection, | |
CoverType.Paper, | |
PageSize.Quarto, | |
PaperType.Inkjet, | |
new Illustration[0], | |
14, | |
100 | |
), | |
100d | |
}, | |
.... | |
}; | |
} | |
public CalculatorOfExpensesForDesignerWorkTests() | |
{ | |
_calculator = new CalculatorOfExpensesForDesignerWork(...); | |
} | |
[Theory] | |
[MemberData(nameof(TestsData))] | |
public void ShouldCalculateExpenses(PrintOrder order, double expectedExpenses) | |
{ | |
Assert.Equal(expectedExpenses, _calculator.Calculate(order)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment