Exemple #1
0
        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();
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        public void ShouldThrowIfArgsParameterIsNull(SetWorkflow sut)
        {
            Action action = () => sut.Process(null);

            action.ShouldThrow <ArgumentNullException>().WithMessage("*args");
        }
Exemple #4
0
 public void ShouldNotSetWorkflowIfNoTemplateFound(SetWorkflow sut, AddDbItemArgs args, DbItem item)
 {
     sut.Process(args);
     item.Fields.ContainsKey(FieldIDs.Workflow).Should().BeFalse();
 }