예제 #1
0
        public void OnetimeSetup()
        {
            CommonSetup();

            _expectedInputUrl  = new Uri("https://www.myfileserver.com/myfile.png");
            _expectedOutputUrl = new Uri("https://www.s3bucket.com/buckets/rebuilt/myfile.png");

            GlasswallVersionServiceMock.Setup(s => s.GetVersion())
            .Returns(Version);

            FileTypeDetectorMock.Setup(s => s.DetermineFileType(It.IsAny <byte[]>()))
            .Returns(_expectedType = new FileTypeDetectionResponse(FileType.Bmp));

            HttpTest.ResponseQueue.Enqueue(new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.OK,
                Content    = new ByteArrayContent(ExpectedDownloadFile)
            });

            HttpTest.ResponseQueue.Enqueue(new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.OK
            });

            FileAnalyserMock.Setup(s => s.GetReport(
                                       It.IsAny <ContentManagementFlags>(),
                                       It.IsAny <string>(),
                                       It.IsAny <byte[]>()))
            .Returns("");

            _result = ClassInTest.AnalyseFromUrl(new UrlRequest
            {
                InputGetUrl = _expectedInputUrl
            });
        }
        public void OnetimeSetup()
        {
            CommonSetup();

            GlasswallVersionServiceMock.Setup(s => s.GetVersion())
            .Returns(Version);

            FileTypeDetectorMock.Setup(s => s.DetermineFileType(It.IsAny <byte[]>()))
            .Returns(_expectedType = new FileTypeDetectionResponse(FileType.Bmp));

            FileAnalyserMock.Setup(s => s.GetReport(
                                       It.IsAny <ContentManagementFlags>(),
                                       It.IsAny <string>(),
                                       It.IsAny <byte[]>()))
            .Returns(DummyXml);

            _result = ClassInTest.AnalyseFromBase64(new Base64Request
            {
                Base64 = "dGVzdA=="
            });
        }