public static Task GetNonEmptyTask() { var task = new Task(); task.Steps.Add(StepMother.GetNonEmptyStep()); return(task); }
public void AddStep_GivenAStepWithoutPosition_ShouldAddToTheEndOfTask() { sut.Task = TaskMother.GetNonEmptyTask(); var step = StepMother.GetNonEmptyStep(); sut.AddStep(step); Assert.That(step.Id, Is.EqualTo(sut[sut.TotalSteps - 1].Id)); }
public void AppendStep_GivenANonEmptyTask_ShouldAppendStepToTheEndOfTask() { sut.Task = TaskMother.GetNonEmptyTask(); var step = StepMother.GetNonEmptyStep(); sut.AppendStep(step); Assert.That(step.Id, Is.EqualTo(sut[sut.TotalSteps - 1].Id)); }
public void ToggleStepStatus_GivenAUnknowStep_ShouldThrowException() { var step = StepMother.GetNonEmptyStep(); sut.AppendStep(step); Assert.That(() => sut.ToggleStepStatus(step.Id + 1), Throws.Exception.With.Message.EqualTo(String.Format("No step with Id {0} found.", step.Id + 1))); }
public void ToggleStepStatus_GivenACloseStep_ShouldChangeStepToOpen() { var step = StepMother.GetNonEmptyStep(); step.Status = StepStatus.Close; sut.AppendStep(step); sut.ToggleStepStatus(step.Id); Assert.That(step.Status, Is.EqualTo(StepStatus.Open)); }
public void AddStep_GivenAStepWithPosition_ShouldAddTheStepInThatPositionInTaskSteps() { var step1 = StepMother.GetNonEmptyStep(); sut.AppendStep(step1); var step2 = StepMother.GetNonEmptyStep(); sut.AppendStep(step2); var newStep = StepMother.GetNonEmptyStep(); var position = 2; sut.AddStep(newStep, position); Assert.That(newStep.Id, Is.EqualTo(sut[position - 1].Id)); }