public void ChangesTvsStateToOnState() { // Arrange IState on = new OnState(); Product tv = new Tv(on); // Act var theStateOfTv = tv.ChangeState(); // Assert Assert.Equal("Current device's state is ON now.", theStateOfTv); }
public void TurnsOnAndThenTurnsOffTheTv() { // Arrange IState on = new OnState(); Product tv = new Tv(on); // Act var theStateOfTv = tv.ChangeState(); Assert.Equal("Current device's state is ON now.", theStateOfTv); // Assert var theStateOfTvIsOff = tv.ChangeState(new OffState()); Assert.Equal("Current device's state is OFF now.", theStateOfTvIsOff); }