public void UpdateStatus() { // Arrange var obj = new SampleStateful(true); // Act obj.Submit(); // Assert Assert.Equal(SampleStates.Submitted, obj.Status.CurrentState); }
public void ExecuteOnEntryAndOnExitActions() { // Arrange var obj = new SampleStateful(true); // Act obj.Submit(); // Assert Assert.True(obj.EntryActionCalled); Assert.True(obj.ExitActionCalled); }
public void NotInvokeActionIfNoTransitionIsAvailable() { // Arrange var obj = new SampleStateful(false); obj.ShouldAllowTransition = false; var expectedSubmitCallCount = obj.SubmitCallCount; // Act obj.Submit(); // Assert Assert.Equal(expectedSubmitCallCount, obj.SubmitCallCount); }
public void ConsiderTriggerGuardIfObjectIsCorrectType() { // Arrange var obj = new SampleStateful(false); obj.ShouldAllowTransition = false; var expectedCount = obj.Status.TransitionHistory.Count; // Act obj.Submit(); // Assert Assert.Equal(expectedCount, obj.Status.TransitionHistory.Count); Assert.Equal(SampleStates.Draft, obj.Status.CurrentState); }