public void When_GetUri() { var image = new LogoSource(new Uri(Helpers.Sample)); // Should be the same thing. Assert.IsTrue(image.GetSourceUri().ToString() == Helpers.Sample); }
public void When_GetUri() { LogoSource image = null; try { image = new LogoSource(new Uri(AssetPath)); // Should be the same thing. Assert.IsTrue(image.GetSourceUri().ToString() == AssetPath); } finally { image?.Dispose(); } }
public async Task When_GetUri() { LogoSource image = null; try { var directData = await PrepareDataAsync().ConfigureAwait(false); var imageStream = new MemoryStream(directData); image = new LogoSource(imageStream); // Logos created from stream must be null. Assert.IsTrue(image.GetSourceUri() == null); imageStream.Dispose(); } finally { image?.Dispose(); } }
public void When_GetUri() { LogoSource image = null; try { using var wc = new WebClient(); byte[] directData = wc.DownloadData(Helpers.Sample); using var imageStream = new MemoryStream(directData); image = new LogoSource(imageStream); // Logos created from stream must be null. Assert.IsTrue(image.GetSourceUri() == null); } finally { image?.Dispose(); } }