public void Execute__MarksActionAsCompleted() { DateTime timeAtStart = DateTime.UtcNow; Mock <IAction> mockAction = AnAction.Mock(); var test = new DoNowCommand(); test.Execute(mockAction.Object); mockAction.VerifySet(x => x.CompletedDate = It.IsInRange(timeAtStart, DateTime.UtcNow, Range.Inclusive)); }
public void DisplayName_WhenSet_SetsActionTitle() { Mock <IAction> mockAction = AnAction.Mock(); var test = new ProcessActionPresenter(mockAction.Object, x => new[] { _fakeProcessor.Object }); const string newTitle = "New title"; test.DisplayName = newTitle; mockAction.VerifySet(x => x.Title = newTitle); }
public void Execute_GivenProject_AddsActionToProjectBlockingActions() { Mock <IAction> mockProject = AnAction.Mock(); _test.Context = AContext.Build(); _test.Project = mockProject.Object; _test.Execute(_fakeAction.Object); mockProject.Verify(x => x.AddBlockingAction(_fakeAction.Object)); }