public void Test() { var food = new WalrusFood(); var can = new CannedWalrusFood(food); var result = subject.Open(can); Assert.Equal(result, food); }
public void Test() { var gary = new Walrus(); var can = new CannedWalrusFood(); var food = new WalrusFood(); var mock = new Mock <IOpensCans>(); mock.Setup(m => m.Open(can)).Returns(food); var opensCans = mock.Object; var subject = new FeedsWalrus(opensCans); subject.Feed(gary, can); Assert.True(gary.HasEaten(food)); }
public void Feed(Walrus gary, CannedWalrusFood can) { gary.AddToStomach(_opensCans.Open(can)); }
public void I_Put_The_Food_In_A_Can() { _cannedFood = new CannedWalrusFood(_food); }
public WalrusFood Open(CannedWalrusFood can) { return(can.ExtractContents()); }