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

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