public void ShouldBeAbleToChangeStateOfANewVentureToCancelled() { var venture = new Venture(new Name("Ventura"), new Amount(100), new Amount(1)); venture.ChangeStateToCancelled(); Assert.AreEqual(Venture.CANCELLED_STATE, venture.State); }
public void ShouldNotBeAbleToStartAVentureIfStatusIsNotProposed() { var venture = new Venture(new Name("Ventura"), new Amount(100), new Amount(1)); venture.ChangeStateToCancelled(); Assert.Throws<Exception>(venture.Start); }
public void ShouldNotBeAbleToDivideDividendsUnlessInAStartedState() { var dividend = new Amount(1000); var venture = new Venture(new Name("Ventura"), new Amount(100), new Amount(1)); Assert.Throws<Exception>(delegate { venture.HandOutDividends(dividend); }); venture.ChangeStateToCancelled(); Assert.Throws<Exception>(delegate { venture.HandOutDividends(dividend); }); venture.ChangeStateToStarted(); Assert.DoesNotThrow(delegate { venture.HandOutDividends(dividend); }); }
public void Should_Be_Able_To_Change_State_Of_A_New_Venture_To_Cancelled() { Venture venture = new Venture(new Name("Ventura"), new Amount(100), new Amount(1)); venture.ChangeStateToCancelled(); Assert.AreEqual(Venture.CANCELLED_STATE, venture.State); }
public void Should_Not_Be_Able_To_Start_A_Venture_If_Status_Is_Not_Proposed() { Venture venture = new Venture(new Name("Ventura"), new Amount(100), new Amount(1)); venture.ChangeStateToCancelled(); Assert.Throws<Exception>(venture.Start); }
public void Should_Not_Be_Able_To_Divide_Dividends_Unless_In_A_Started_State() { Amount dividend = new Amount(1000); Venture venture = new Venture(new Name("Ventura"), new Amount(100), new Amount(1)); Assert.Throws<Exception>(delegate { venture.HandOutDividends(dividend); }); venture.ChangeStateToCancelled(); Assert.Throws<Exception>(delegate { venture.HandOutDividends(dividend); }); venture.ChangeStateToStarted(); Assert.DoesNotThrow(delegate { venture.HandOutDividends(dividend); }); }