Exemple #1
0
        public async Task When_server_supports_three_OCR_languages()
        {
            mockServer
            .Given(Request.Create().WithPath("/v2/contentConverters").UsingPost())
            .RespondWith(Response.Create()
                         .WithStatusCode(480)
                         .WithHeader("Content-Type", "application/json")
                         .WithBody("{\"errorCode\":\"InvalidInput\",\"errorDetails\":{\"in\":\"body\",\"at\":\"input.dest.pdfOptions.ocr.language\",\"expected\":{\"enum\":[\"english\",\"greek\",\"hebrew\"]}}}"));

            var dummyInput = new ConversionSourceDocument(new RemoteWorkFile(null, null, null, null));

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync(dummyInput, new DestinationOptions(DestinationFileFormat.Pdf)
                {
                    PdfOptions = new PdfDestinationOptions
                    {
                        Ocr = new OcrOptions
                        {
                            Language = "hylian",
                        },
                    },
                });
            }, "Unsupported OCR language \"hylian\". The remote server only supports the following OCR languages: \"english\", \"greek\", \"hebrew\".");
        }
        public async Task When_requesting_PDF_OCR_but_the_feature_is_not_licensed()
        {
            mockServer
            .Given(Request.Create().WithPath("/v2/contentConverters").UsingPost())
            .RespondWith(Response.Create()
                         .WithStatusCode(480)
                         .WithHeader("Content-Type", "application/json")
                         .WithBody("{\"errorCode\":\"FeatureNotLicensed\",\"errorDetails\":{\"in\":\"body\",\"at\":\"input.dest.pdfOptions.ocr\"}}"));

            var dummyInput = new ConversionSourceDocument(new RemoteWorkFile(null, null, null, null));

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync(dummyInput, new DestinationOptions(DestinationFileFormat.Pdf)
                {
                    PdfOptions = new PdfDestinationOptions
                    {
                        Ocr = new OcrOptions
                        {
                            Language = "english",
                        },
                    },
                });
            }, "Remote server is not licensed to perform OCR when producing PDF output.");
        }
Exemple #3
0
        public void RandomPatternModel_UsesProvidedPatterns()
        {
            // Given
            var info = new DataGenerationInfo
            {
                RowsToGenerate = 10
            };
            var patterns = new Dictionary <string, string> {
                { "odd", "13579" }, { "even", "02468" }, { "vowel", "aeiou" }
            };

            info.Columns.Add(new RandomPatternModel(_customPatternProviderMock.Object)
            {
                Name = "testColumn", Template = "{odd}{vowel}{even}", Patterns = patterns
            });
            _customPatternProviderMock.Setup(p => p.GetDefaultPatterns()).Returns(default(IDictionary <string, string>));
            _serviceLocatorMock.Setup(l => l.GetService(It.IsAny <Type>()))
            .Returns(new GeneratorRandomPattern(_customPatternProviderMock.Object));

            // When
            var result = _dataGeneratorDataSet.Generate(info);

            // Then
            Assert.AreEqual(1, result.Tables.Count);
            Assert.AreEqual(10, result.Tables[0].Rows.Count);
            UtilAssert.AssertStringLength(result.Tables[0], "testColumn", 3, 3);
            UtilAssert.AssertIndexContains(result.Tables[0], "testColumn", 0, "13579");
            UtilAssert.AssertIndexContains(result.Tables[0], "testColumn", 1, "aeiou");
            UtilAssert.AssertIndexContains(result.Tables[0], "testColumn", 2, "02468");
        }
Exemple #4
0
        public void DateTimeRangeModel_CorrectLimits_Generates()
        {
            // Given
            var info = new DataGenerationInfo
            {
                RowsToGenerate = 10
            };
            DateTime minDate = new(1980, 1, 1);
            DateTime maxDate = new(1989, 12, 31);
            var      minTime = DateTime.Today.AddHours(4);
            var      maxTime = DateTime.Today.AddHours(5);

            info.Columns.Add(new DateTimeRangeModel
            {
                Name = "testColumn", MinDate = minDate, MaxDate = maxDate, MinTime = minTime, MaxTime = maxTime
            });

            // When
            var result = _dataGeneratorDataSet.Generate(info);

            // Then
            Assert.AreEqual(1, result.Tables.Count);
            Assert.AreEqual(10, result.Tables[0].Rows.Count);
            UtilAssert.AssertDateInRange(result.Tables[0], "testColumn", minDate, maxDate);
        }
Exemple #5
0
        public void RandomPatternModel_UsesDefaultPatterns()
        {
            // Given
            var info = new DataGenerationInfo
            {
                RowsToGenerate = 10
            };

            info.Columns.Add(new RandomPatternModel(_customPatternProviderMock.Object)
            {
                Name = "testColumn", Template = "{uc}{d}{lc}"
            });
            _customPatternProviderMock
            .Setup(p => p.GetDefaultPatterns())
            .Returns(new Dictionary <string, string>
            {
                { "uc", "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
                { "lc", "abcdefghijklmnopqrstuvwxyz" },
                { "d", "0123456789" }
            });
            _serviceLocatorMock.Setup(l => l.GetService(It.IsAny <Type>()))
            .Returns(new GeneratorRandomPattern(_customPatternProviderMock.Object));

            // When
            var result = _dataGeneratorDataSet.Generate(info);

            // Then
            Assert.AreEqual(1, result.Tables.Count);
            Assert.AreEqual(10, result.Tables[0].Rows.Count);
            UtilAssert.AssertStringLength(result.Tables[0], "testColumn", 3, 3);
            UtilAssert.AssertIndexContains(result.Tables[0], "testColumn", 0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
            UtilAssert.AssertIndexContains(result.Tables[0], "testColumn", 1, "0123456789");
            UtilAssert.AssertIndexContains(result.Tables[0], "testColumn", 2, "abcdefghijklmnopqrstuvwxyz");
        }
Exemple #6
0
        public void TemplateModel_Inline_Generates()
        {
            // Given
            var content = new List <object> {
                "red", "green", "blue"
            };
            var sources = new List <ItemSourceModel>
            {
                new InlineSourceModel {
                    Name = "color", Content = content
                }
            };
            var info = new DataGenerationInfo
            {
                RowsToGenerate = 10,
                Sources        = sources
            };

            info.Columns.Add(new TemplateModel(_defaultSourceProvider)
            {
                Name = "testColumn", Template = "{color}"
            });

            SetupServiceLocator();

            // When
            var result = _dataGeneratorDataSet.Generate(info);

            // Then
            Assert.AreEqual(1, result.Tables.Count);
            Assert.AreEqual(10, result.Tables[0].Rows.Count);
            var expectedList = content.Select(c => c.ToString()).ToList();

            UtilAssert.AssertStringsInList(result.Tables[0], "testColumn", expectedList);
        }
        public async Task When_the_second_of_three_input_work_files_does_not_exist()
        {
            var remoteWorkFile0 = new RemoteWorkFile(null, "ML3AbF-qzIH5K9mVVxTlBX", "FCnaLL517YPRAnrcX2wlnKURpNPsp2d2pMPkcvCcpdY=", "docx");
            var remoteWorkFile1 = new RemoteWorkFile(null, "S5uCdv7vnkTRzKKlTvhtaw", "FCnaLL517YPRAnrcX2wlnKURpNPsp2d2pMPkcvCcpdY=", "docx");
            var remoteWorkFile2 = new RemoteWorkFile(null, "5J15gtlduA_xORR8j7ejSg", "FCnaLL517YPRAnrcX2wlnKURpNPsp2d2pMPkcvCcpdY=", "docx");

            var input0 = new ConversionSourceDocument(remoteWorkFile0);
            var input1 = new ConversionSourceDocument(remoteWorkFile1, pages: "2-");
            var input2 = new ConversionSourceDocument(remoteWorkFile2);

            mockServer
            .Given(Request.Create().WithPath("/v2/contentConverters").UsingPost())
            .RespondWith(Response.Create()
                         .WithStatusCode(480)
                         .WithHeader("Content-Type", "application/json")
                         .WithBody("{\"input\":{\"dest\":{\"format\":\"pdf\",\"pdfOptions\":{\"forceOneFilePerPage\":false}},\"sources\":[{\"fileId\":\"LxuuLktmmMaicAs1wMvvsQ\",\"pages\":\"\"},{\"fileId\":\"S5uCdv7vnkTRzKKlTvhtaw\",\"pages\":\"2-\"},{\"fileId\":\"5J15gtlduA_xORR8j7ejSg\",\"pages\":\"\"}]},\"minSecondsAvailable\":18000,\"errorCode\":\"WorkFileDoesNotExist\",\"errorDetails\":{\"in\":\"body\",\"at\":\"input.sources[1].fileId\"}}"));

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync(
                    new List <ConversionSourceDocument>
                {
                    input0, input1, input2,
                },
                    new DestinationOptions(DestinationFileFormat.Pdf));
            }, "ConversionSourceDocument at index 1 refers to a remote work file which does not exist. It may have expired.");
        }
Exemple #8
0
        public async Task When_applying_a_footer_to_multiple_sources()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync(
                    new List <ConversionSourceDocument>
                {
                    new ConversionSourceDocument("documents/example.pdf"),
                    new ConversionSourceDocument("documents/example.pdf"),
                    new ConversionSourceDocument("documents/example.pdf"),
                },
                    new DestinationOptions(DestinationFileFormat.Pdf)
                {
                    Footer = new HeaderFooterOptions()
                    {
                        Lines = new List <HeaderFooterLine>()
                        {
                            new HeaderFooterLine()
                            {
                                Left = "Acme"
                            },
                        },
                    },
                });
            }, "Remote server does not support applying headers or footers when using multiple ConversionSourceDocument instances. To apply headers or footers, use a single ConversionSourceDocument instance.");
        }
Exemple #9
0
        public async Task RedactToPlainTextAsync_fails_with_a_useful_error_message_when_the_markup_json_file_is_not_actually_JSON()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.RedactToPlainTextAsync("documents/confidential-contacts.pdf", "documents/example.docx", "\n");
            }, "The remove server was unable to burn the markup file into the document because the markup file was not valid JSON.");
        }
Exemple #10
0
        public async Task BurnMarkupAsync_fails_with_a_useful_error_message_when_the_markup_json_file_is_not_actually_JSON()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.BurnMarkupAsync("documents/confidential-contacts.pdf", "documents/example.docx");
            }, "The remote server was unable to burn the markup file into the document. It is possible there is a problem with the markup JSON or with the document itself.");
        }
        public async Task BurnMarkupAsync_fails_with_a_useful_error_message_when_the_source_document_is_unusable()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.BurnMarkupAsync("documents/corrupted-page-count.pdf", "documents/confidential-contacts.pdf.markup.json");
            }, "The remote server was unable to burn the markup file into the document. It is possible there is a problem with the markup JSON or with the document itself.");
        }
        public async Task When_using_a_single_password_protected_source_document_and_the_wrong_password_is_given()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync(new ConversionSourceDocument("documents/password.docx", password: "******"), new DestinationOptions(DestinationFileFormat.Pdf));
            }, "Invalid password for ConversionSourceDocument (\"documents/password.docx\").");
        }
        public async Task RedactToPlainTextAsync_fails_with_a_useful_error_message_when_an_unsupported_line_ending_is_used()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.RedactToPlainTextAsync("documents/confidential-contacts.pdf", "documents/confidential-contacts.pdf.markup.json", "wat");
            }, "Unsupported line ending \"wat\". The remote server only supports the following values: \"\\n\", \"\\r\\n\".");
        }
        public async Task CAD_to_TIFF()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync(new ConversionSourceDocument("documents/example.dwg"), new DestinationOptions(DestinationFileFormat.Tiff));
            }, "When converting a CAD ConversionSourceDocument to TIFF, you must specify TiffOptions.MaxWidth or TiffOptions.MaxHeight.");
        }
Exemple #15
0
        public async Task When_using_a_single_source_input()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync(new ConversionSourceDocument("documents/example.pdf", pages: "wat"), new DestinationOptions(DestinationFileFormat.Pdf));
            }, "ConversionSourceDocument (\"documents/example.pdf\") has an invalid value for \"pages\". A valid pages value is a string like \"1\", \"1,3,5-10\", or \"2-\" (just like in a print dialog).");
        }
Exemple #16
0
        public async Task BurnMarkupAsync_fails_with_a_useful_error_message_when_the_markup_json_file_contains_content_which_does_not_pass_schema_validation()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.BurnMarkupAsync("documents/confidential-contacts.pdf", "documents/content-fails-schema-validation.markup.json");
            }, "The remote server rejected the given markup JSON because it contained content which did not conform to its allowed markup JSON schema. See the markup JSON schema documentation for your version of PrizmDoc Viewer (such as https://help.accusoft.com/PrizmDoc/latest/HTML/webframe.html#markup-json-specification.html).");
        }
        public async Task CreateRedactionsAsync_fails_with_a_useful_error_message_when_the_source_document_is_unusable()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.CreateRedactionsAsync("documents/corrupted-page-count.pdf", new[] { new RegexRedactionMatchRule("wat") });
            }, "The remote server encountered an error when trying to create redactions for the given document. There may be a problem with the document itself.");
        }
        public async Task Unexpected_bare_418_on_POST()
        {
            mockServer
            .Given(Request.Create().WithPath("/PCCIS/V1/MarkupBurner").UsingPost())
            .RespondWith(Response.Create().WithStatusCode(418));

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() => { await prizmDocServer.BurnMarkupAsync("documents/confidential-contacts.pdf", "documents/confidential-contacts.pdf.markup.json"); },
                expectedMessage : @"Remote server returned an error: I'm a teapot",
                ignoreCase : true);
        }
        public async Task When_using_a_single_source_input()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            // This assertion is coupled to what is currently supported in the product. It would be better if we used a mock for this test.
            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync(new ConversionSourceDocument("documents/example.mp3"), new DestinationOptions(DestinationFileFormat.Pdf));
            }, "Unsupported file format \"mp3\". The remote server only supports the following input file formats: \"bmp\", \"cal\", \"cals\", \"csv\", \"cur\", \"cut\", \"dcim\", \"dcm\", \"dcx\", \"dgn\", \"dib\", \"dicm\", \"dicom\", \"doc\", \"docm\", \"docx\", \"dot\", \"dotm\", \"dotx\", \"dwf\", \"dwg\", \"dxf\", \"eml\", \"emz\", \"fodg\", \"fodp\", \"fods\", \"fodt\", \"gif\", \"htm\", \"html\", \"ico\", \"img\", \"jp2\", \"jpc\", \"jpeg\", \"jpg\", \"jpx\", \"msg\", \"ncr\", \"odg\", \"odp\", \"ods\", \"odt\", \"otg\", \"otp\", \"ots\", \"ott\", \"pbm\", \"pcd\", \"pct\", \"pcx\", \"pdf\", \"pgm\", \"pic\", \"pict\", \"png\", \"pot\", \"potm\", \"potx\", \"ppm\", \"pps\", \"ppsm\", \"ppsx\", \"ppt\", \"pptm\", \"pptx\", \"psb\", \"psd\", \"ras\", \"rtf\", \"sct\", \"sgi\", \"tga\", \"tif\", \"tiff\", \"tpic\", \"txt\", \"vdx\", \"vsd\", \"vsdm\", \"vsdx\", \"wbmp\", \"wmf\", \"wmz\", \"wpg\", \"xbm\", \"xhtml\", \"xls\", \"xlsm\", \"xlsx\", \"xlt\", \"xltm\", \"xltx\", \"xwd\"");
        }
        public async Task Will_throw_an_exception_if_given_a_path_to_a_local_file_which_cannot_be_found()
        {
            AffinitySession affinitySession = Util.RestClient.CreateAffinitySession();
            var             input           = new ConversionSourceDocument("documents/does not exist.pdf");

            Assert.IsNull(input.RemoteWorkFile);

            await UtilAssert.ThrowsExceptionWithMessageAsync <FileNotFoundException>(
                async() => { await input.EnsureUsableRemoteWorkFileAsync(affinitySession); },
                "File not found: \"documents/does not exist.pdf\"");
        }
Exemple #21
0
        public void ColumnGuidModel()
        {
            // Given
            var json = @"{ name: ""testColumn"", sourceType: ""Guid"" }";

            // When
            var columnDefinition = _columnDefinitionLoader.Load(json);

            // Then
            Assert.AreEqual("testColumn", columnDefinition.Name);
            UtilAssert.IsInstanceOfType <GuidModel>(columnDefinition);
        }
        public async Task Footer_with_JPEG_output()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync("documents/example.pdf", new DestinationOptions(DestinationFileFormat.Jpeg)
                {
                    Footer = this.exampleHeaderFooterContent
                });
            }, "Remote server does not support applying headers or footers when producing JPEG output.");
        }
Exemple #23
0
        public void GuidModel_GeneratesGuid()
        {
            // Given
            var json = @"{ ""columns"": [ { name: ""myColumn"", sourceType: ""Guid"" } ], rowsToGenerate: 1000 }";

            // When
            var definition = _dataGenerationParser.Load(json);

            // Then
            Assert.AreEqual(1, definition.Columns.Count);
            Assert.AreEqual(1000, definition.RowsToGenerate);
            UtilAssert.IsInstanceOfType <GuidModel>(definition.Columns[0]);
        }
Exemple #24
0
 public async Task Multiple_to_JPEG()
 {
     await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
         async() =>
     {
         await prizmDocServer.ConvertAsync(
             new List <ConversionSourceDocument>
         {
             new ConversionSourceDocument("documents/example.docx"),
             new ConversionSourceDocument("documents/example.pdf"),
         },
             new DestinationOptions(DestinationFileFormat.Jpeg));
     }, "Remote server does not support combining multiple ConversionSourceDocument instances to JPEG. When converting to JPEG, use a single ConversionSourceDocument.");
 }
Exemple #25
0
        public async Task When_work_file_does_not_exist()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            AffinitySession affinitySession = Util.RestClient.CreateAffinitySession();
            RemoteWorkFile  validWorkFile   = await affinitySession.UploadAsync("documents/confidential-contacts.pdf");

            RemoteWorkFile invalidWorkFile = new RemoteWorkFile(affinitySession, "non-existent-id", validWorkFile.AffinityToken, "pdf");

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.CreateRedactionsAsync(invalidWorkFile, new[] { new RegexRedactionMatchRule("dummy rule") });
            }, "Could not use the given RemoteWorkFile as the source document: the work file resource could not be found on the remote server. It may have expired.");
        }
Exemple #26
0
        public async Task TIFF_bad_MaxHeight()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync("documents/example.pdf", new DestinationOptions(DestinationFileFormat.Tiff)
                {
                    TiffOptions = new TiffDestinationOptions {
                        MaxHeight = "wat"
                    },
                });
            }, $"Invalid TiffOptions.MaxHeight for remote server: \"wat\". Try using a CSS-style string, like \"600px\".");
        }
Exemple #27
0
        public void ColumnDoubleRangeModel()
        {
            // Given
            var json = @"{ name: ""testColumn"", sourceType: ""DoubleRange"", min: 0.0, max: 99.9 }";

            // When
            var columnDefinition = _columnDefinitionLoader.Load(json);

            // Then
            Assert.AreEqual("testColumn", columnDefinition.Name);
            var model = UtilAssert.IsInstanceOfType <DoubleRangeModel>(columnDefinition);

            Assert.AreEqual(0, model.Min);
            Assert.AreEqual(99.9, model.Max);
        }
Exemple #28
0
        public async Task BurnMarkupAsync_fails_with_a_useful_error_message_when_the_source_document_cannot_be_found()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            AffinitySession affinitySession    = Util.RestClient.CreateAffinitySession();
            RemoteWorkFile  existingMarkupFile = await affinitySession.UploadAsync("documents/confidential-contacts.pdf.markup.json");

            RemoteWorkFile nonExistentSourceDocument = new RemoteWorkFile(affinitySession, "non-existent-id", existingMarkupFile.AffinityToken, "pdf");

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.BurnMarkupAsync(nonExistentSourceDocument, existingMarkupFile);
            }, "Could not use the given RemoteWorkFile as the source document: the work file resource could not be found on the remote server. It may have expired.");
        }
Exemple #29
0
        public async Task PNG_bad_MaxWidth()
        {
            PrizmDocServerClient prizmDocServer = Util.CreatePrizmDocServerClient();

            await UtilAssert.ThrowsExceptionWithMessageAsync <RestApiErrorException>(
                async() =>
            {
                await prizmDocServer.ConvertAsync("documents/example.pdf", new DestinationOptions(DestinationFileFormat.Png)
                {
                    PngOptions = new PngDestinationOptions {
                        MaxWidth = "wat"
                    },
                });
            }, $"Invalid PngOptions.MaxWidth for remote server: \"wat\". Try using a CSS-style string, like \"800px\".");
        }
Exemple #30
0
        public void ColumnIntegerRangeModel()
        {
            // Given
            var json = @"{ name: ""testColumn"", sourceType: ""IntegerRange"", min: 5, max: 15 }";

            // When
            var columnDefinition = _columnDefinitionLoader.Load(json);

            // Then
            Assert.AreEqual("testColumn", columnDefinition.Name);
            var model = UtilAssert.IsInstanceOfType <IntegerRangeModel>(columnDefinition);

            Assert.AreEqual(5, model.Min);
            Assert.AreEqual(15, model.Max);
        }