Exemplo n.º 1
0
        public void UploadScreenshotToAmazonS3()
        {
            IUpload upload = new Upload();
            IScreenshot screenshot;

            //Upload that screenshot to Amazon S3
            screenshot = upload.AmazonS3();

            Assert.AreEqual(true, screenshot.Url.Contains(config.AppSettings.Settings["BucketName"].Value));
            Assert.AreEqual(true, screenshot.Url.Contains(config.AppSettings.Settings["FileName"].Value));
            Assert.AreEqual(false, screenshot.Url.Contains("Expires"));


            //Check the Amazon Url is valid
            Uri uriResult;
            bool isValidUrl = Uri.TryCreate(screenshot.Url, UriKind.Absolute, out uriResult) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
            Assert.AreEqual(true, isValidUrl);
        }
Exemplo n.º 2
0
        public void HasCorrectAmazonS3RegionEndpoint()
        {
            IUpload upload = new Upload();

            Assert.AreEqual(RegionEndpoint.USEast1, upload.s3RegionEndpoint);
        }