public void ShouldBeDoneWhenActiveTaskIsNotOfficeTask() { // given var activeTask = GetActiveProjectTask(); var chosenProjectID = (ulong)2; validator = new DuplicateOfficeTaskValidator(activeTask, chosenProjectID); // then Assert.DoesNotThrow(() => validator.ValidateDuplicate()); }
public void ShouldThrowExceptionWhenChosenProjectIsLikeActiveOfficeTaskProject() { // given var activeTask = GetActiveOfficeTask(); var chosenProjectID = (ulong)1; validator = new DuplicateOfficeTaskValidator(activeTask, chosenProjectID); // when var ex = Assert.Throws <DuplicateTaskException>(() => validator.ValidateDuplicate()); // then Assert.That(ex.Message == "Zadanie jest już uruchomione"); }
public void ShouldBeDoneWhenIsAddCostIsUnlikeActiveProjectTask() { // given var activeTask = GetActiveProjectTask(); var chosenProjectID = (ulong)1; var chosenProjectStageID = (ulong)1; var chosenWorksetID = (ulong)1; var isAddCost = true; var isMistake = false; validator = new DuplicateProjectTaskValidator(activeTask, chosenProjectID, chosenProjectStageID, chosenWorksetID, isAddCost, isMistake); // then Assert.DoesNotThrow(() => validator.ValidateDuplicate()); }
public void ShouldThrowExceptionWhenChosenAllSettingsForNewProjectTaskIsLikeActiveProjectTask() { // given var activeTask = GetActiveProjectTask(); var chosenProjectID = (ulong)1; var chosenProjectStageID = (ulong)1; var chosenWorksetID = (ulong)1; var isAddCost = false; var isMistake = false; validator = new DuplicateProjectTaskValidator(activeTask, chosenProjectID, chosenProjectStageID, chosenWorksetID, isAddCost, isMistake); // when var ex = Assert.Throws <DuplicateTaskException>(() => validator.ValidateDuplicate()); // then Assert.That(ex.Message == "Zadanie jest już uruchomione"); }