21 lines
659 B
C#
21 lines
659 B
C#
using IceCreamBuyers;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using System.Collections.Generic;
|
|
|
|
namespace IceCreamBuyers.Tests
|
|
{
|
|
[TestClass]
|
|
public class BuyersTests
|
|
{
|
|
[TestMethod]
|
|
public void ShoppingListTotalUsesThePricingWePassIn()
|
|
{
|
|
// pure pricing function: everything costs 2.
|
|
// Anke: 2 flavours x 2 scoops x 2 = 8 — deterministic, glanceable.
|
|
var buyers = new Buyers();
|
|
var anke = new Buyer("Anke", new List<IceCream> { IceCream.Strawberry, IceCream.Vanilla });
|
|
Assert.AreEqual(8, buyers.ShoppingListTotal(anke, _ => 2));
|
|
}
|
|
}
|
|
}
|