Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save litichevskiydv/6ddfa430ca2ca3eaf3c7a44f1d22758c to your computer and use it in GitHub Desktop.
Save litichevskiydv/6ddfa430ca2ca3eaf3c7a44f1d22758c to your computer and use it in GitHub Desktop.
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