Esempio n. 1
0
        public void PostUploadImage_ShouldUpload()
        {
            var expectedLink   = "link";
            var file           = Substitute.For <IFormFile>();
            var fileStreamMock = new MemoryStream();

            file.OpenReadStream().Returns(fileStreamMock);
            _imgurGateway.UploadImage(fileStreamMock).Returns(expectedLink);

            var results = _controller.PostUploadImage(file).Result;

            Assert.AreEqual(expectedLink, results);
        }