ChangeStateToCancelled() public method

public ChangeStateToCancelled ( ) : void
return void
Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 public void ShouldNotBeAbleToStartAVentureIfStatusIsNotProposed()
 {
     var venture = new Venture(new Name("Ventura"), new Amount(100), new Amount(1));
     venture.ChangeStateToCancelled();
     Assert.Throws<Exception>(venture.Start);
 }
Esempio n. 3
0
 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); });
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 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); });
 }