public void Return_Candy() { var mockCandy = new Mock <ICandy>(); mockCandy.Setup(x => x.Price).Returns(-2); _sut = new SweetMachine(new List <ICandy> { mockCandy.Object }); _sut.GiveMeCandy().Price.Should().Be(-2); }
public void Return_Multiple_Candy(decimal firstPrice, decimal secondPrice) { var mockCandy = new Mock <ICandy>(); mockCandy.Setup(x => x.Price).Returns(firstPrice); var mockCandy2 = new Mock <ICandy>(); mockCandy2.Setup(x => x.Price).Returns(secondPrice); _sut = new SweetMachine(new List <ICandy> { mockCandy.Object, mockCandy2.Object }); _sut.GiveMeCandy(2).Price.Should().Be(firstPrice + secondPrice); }
public SweetMachineShould() { _sut = new SweetMachine(_mockListOfCandies); _sut.InsertMoney(5); }