public static DescriptionCase WithoutDescriptionAtAll(DocflowType docflowType) { return(new DescriptionCase( docflowType, g => g.GenerateDocflowWithoutDescription(docflowType), null )); }
public void Should_create_correct_filter_with_existing_docflow_type(DocflowType type) { var filter = new DocflowFilterBuilder() .WithTypes(type) .CreateFilter(); ShouldHaveExpectedQueryParameters(filter, ("type", type.ToUrn() !.Nss)); }
public static DescriptionCase WithDescription(Type descriptionClass, DocflowType docflowType) { return(new DescriptionCase( docflowType, g => g.GenerateDocflowWithDescription(descriptionClass, docflowType), descriptionClass )); }
public void Should_return_null_description_if_it_is_unknown_and_missed() { var docflowType = new DocflowType(DocflowType.Namespace.Append("unknown-docflow")); var originalDocflow = descriptionGenerator.GenerateDocflowWithoutDescription(docflowType); var json = serializer.SerializeToIndentedString(originalDocflow); Console.WriteLine($"Generated JSON: {json}"); var docflow = serializer.Deserialize <Docflow>(json); docflow.Type.Should().Be(docflowType); docflow.Description.Should().BeNull(); }
public void Should_return_unknown_description_in_case_of_unknown_docflow_type() { var unknownDocflowType = new DocflowType(DocflowType.Namespace.Append("unknown-docflow")); var originalDocflow = descriptionGenerator.GenerateDocflowWithoutDescription(unknownDocflowType); originalDocflow.Description = new ReportDescription { FinalRecipient = "123" }; var json = serializer.SerializeToIndentedString(originalDocflow); Console.WriteLine($"Generated JSON: {json}"); var docflow = serializer.Deserialize <Docflow>(json); docflow.Type.Should().Be(unknownDocflowType); docflow.Description.Should().BeOfType <UnknownDescription>(); }
public Docflow( Guid id, Guid organizationId, DocflowType type, DocflowStatus status, DocflowState successState, List <Link> links, DateTime sendDateTime, DateTime?lastChangeDateTime, DocflowDescription description) { Id = id; OrganizationId = organizationId; Type = type; Status = status; SuccessState = successState; Links = links; SendDateTime = sendDateTime; LastChangeDateTime = lastChangeDateTime; Description = description; Documents = new List <Document>(); }
private DescriptionCase(DocflowType docflowType, Func <DocflowDescriptionGenerator, Docflow> expectedDescriptionFactory, Type? descriptionType) { this.expectedDescriptionFactory = expectedDescriptionFactory; DocflowType = docflowType; this.descriptionType = descriptionType; }
public void Should_return_a_description_for_docflow_type(DocflowType docflowType) { var descriptionType = DocflowDescriptionTypes.TryGetDescriptionType(docflowType); descriptionType.Should().NotBeNull(); }
public void Should_initialize_with_given_urn() { var docflowType = new DocflowType("urn:docflow:fss-sedo-sick-report-change-notification"); docflowType.ToString().Should().Be("urn:docflow:fss-sedo-sick-report-change-notification"); }
public void Should_fail_when_urn_not_belong_to_docflow_type_namespace() { Action action = () => _ = new DocflowType("urn:document:fss-sedo-error-exchange-error"); action.Should().Throw <ArgumentException>(); }
public void Should_fail_when_given_invalid_urn(string urn) { Action action = () => _ = new DocflowType(urn); action.Should().Throw <Exception>(); }