public void ShouldNotSetWorkflowIfNoDefaultWorkflowOnTemplate( SetWorkflow sut, DbItem item, DbTemplate template, [Substitute] DataStorage dataStorage) { dataStorage.GetFakeTemplate(item.TemplateID).Returns(template); var args = new AddDbItemArgs(item, dataStorage); sut.Process(args); item.Fields.ContainsKey(FieldIDs.Workflow).Should().BeFalse(); }
public void ShouldSetItemWorkflow( SetWorkflow sut, DbItem item, DbTemplate template, [Substitute] DataStorage dataStorage, string workflowId) { template.Add(FieldIDs.DefaultWorkflow, workflowId); dataStorage.GetFakeTemplate(item.TemplateID).Returns(template); var args = new AddDbItemArgs(item, dataStorage); sut.Process(args); item.Fields[FieldIDs.Workflow].Value.Should().Be(workflowId); }
public void ShouldThrowIfArgsParameterIsNull(SetWorkflow sut) { Action action = () => sut.Process(null); action.ShouldThrow <ArgumentNullException>().WithMessage("*args"); }
public void ShouldNotSetWorkflowIfNoTemplateFound(SetWorkflow sut, AddDbItemArgs args, DbItem item) { sut.Process(args); item.Fields.ContainsKey(FieldIDs.Workflow).Should().BeFalse(); }