public async void TestMediaOptionsMutationDoesNotAffectSession() { var resizing = new MockMutableMediaOptions(); resizing.SetWidth(100); resizing.SetHeight(500); string mediaPath = "/sitecore/media library/xyz"; try { IMediaResourceDownloadRequest request = new MediaResourceDownloadParameters(null, this.itemSource, resizing, mediaPath); using (Stream imageStream = await this.session.DownloadMediaResourceAsync(request)) { Assert.IsNotNull(imageStream); } } catch (LoadDataFromNetworkException) { //IDLE } finally { Assert.AreEqual(1, resizing.CopyConstructorInvocationCount); Assert.AreEqual(1, this.itemSource.CopyInvocationCount); } }
public IMediaResourceDownloadRequest Build() { var result = new MediaResourceDownloadParameters(null, this.itemSourceAccumulator, this.downloadMediaOptions, this.mediaPath); return(result); }