ChangeStateToCancelled() 공개 메소드

public ChangeStateToCancelled ( ) : void
리턴 void
예제 #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);
 }
예제 #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);
 }
예제 #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); });
 }
예제 #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);
 }
예제 #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);
 }
예제 #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); });
 }