public void CanCreateGumballMachineWithoutAddingGumballsInSoldOutState() { var strState = "sold out"; uint gumballs = 0; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(); Assert.AreEqual(gM.GetBallCount(), (uint)0); Assert.AreEqual(gM.ToString(), testStr); }
public void CanCreateGumballMachineWithAddingMoreThan1GumballsInNoQuarterState() { var strState = "waiting for quarter"; uint gumballs = 2; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(gumballs); Assert.AreEqual(gM.GetBallCount(), gumballs); Assert.AreEqual(gM.ToString(), testStr); }
public void CantEjectQuartersInSoldOutState() { var strState = "sold out"; uint gumballs = 0; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(); gM.EjectQuarters(); Assert.AreEqual(gM.GetBallCount(), gumballs); Assert.AreEqual(gM.ToString(), testStr); }
public void CanRefillGumballMachineWithAddingMoreThan0GumballsInSoldOutStateAndMoveToNoQuarterState() { var strState = "waiting for quarter"; uint gumballs = 1; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(); gM.Refill(gumballs); Assert.AreEqual(gM.GetBallCount(), gumballs); Assert.AreEqual(gM.ToString(), testStr); }
public void CanRefillGumballMachineWithAdding0GumballsInSoldOutState() { var strState = "sold out"; uint gumballs = 0; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(gumballs); gM.Refill(0); Assert.AreEqual(gM.GetBallCount(), gumballs); Assert.AreEqual(gM.ToString(), testStr); }
public void CanInsertQuarterInNoQuarterStateAndMoveToHasQuarterState() { var strState = "waiting for turn of crank"; uint gumballs = 1; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(gumballs); gM.InsertQuarter(); Assert.AreEqual(gM.GetBallCount(), gumballs); Assert.AreEqual(gM.ToString(), testStr); }
public void CantEjectQuartersInNoQuarterState() { var strState = "waiting for quarter"; uint gumballs = 2; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(gumballs); gM.EjectQuarters(); Assert.AreEqual(gM.GetBallCount(), gumballs); Assert.AreEqual(gM.ToString(), testStr); }
public void CanInsertQuarterTurnCrankInHasQuarterStateAndDespenseBallAndMovetoSoldOutStateIfBalls0() { var strState = "sold out"; uint gumballs = 0; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(1); gM.InsertQuarter(); gM.TurnCrank(); Assert.AreEqual(gM.GetBallCount(), gumballs); Assert.AreEqual(gM.ToString(), testStr); }
public void CanInsertQuarterTurnCrankInHasQuarterStateAndDespenseBallAndMovetoNoQuarterStateIfBallsMoreThan0() { var strState = "waiting for quarter"; uint gumballs = 1; var testStr = GetGumballMachineTestParsedString(gumballs, strState); var gM = new GumballMachine(2); gM.InsertQuarter(); gM.TurnCrank(); Assert.AreEqual(gM.GetBallCount(), gumballs); Assert.AreEqual(gM.ToString(), testStr); }
public void CanGetBallsCount() { var gM = new GumballMachine(); Assert.AreEqual(gM.GetBallCount(), (uint)0); }