public PartialViewResult _8([FromBody] int people, int pizzas, int slicesPerPizza) { Ex8 ex = new Ex8(people, pizzas, slicesPerPizza); int slicesPerPerson = ex.GetSlicesPerPerson(); int leftOvers = ex.GetLeftOvers(); return(PartialView("_8_partial", new int[] { people, pizzas, slicesPerPerson, leftOvers })); }
public void _8_When4Pizza5People8Slices_SholudReturn6SlicePerPersonAnd2Leftover() { int people = 5; int pizza = 4; int slices = 8; int expectedSlicePerPerson = 6; int expectedLeftOvers = 2; // Act Ex8 ex = new Ex8(people, pizza, slices); int actualSlicesPerPerson = ex.GetSlicesPerPerson(); int actualLeftOvers = ex.GetLeftOvers(); // Assert Assert.AreEqual(expectedSlicePerPerson, actualSlicesPerPerson); Assert.AreEqual(expectedLeftOvers, actualLeftOvers); }