public virtual void RetrieveStreamPngImageTest() { String fileName = "resourceResolverTest.png"; ResourceResolver resourceResolver = new ResourceResolver(baseUri); byte[] expected = File.ReadAllBytes(baseUri + fileName); byte[] stream = resourceResolver.RetrieveStream(fileName); Assert.NotNull(resourceResolver.RetrieveStream(fileName)); Assert.AreEqual(expected.Length, stream.Length); }
public virtual void malformedResourceNameTest() { String fileName = "resourceResolverTest .png"; ResourceResolver resourceResolver = new ResourceResolver(baseUri); resourceResolver.RetrieveStream(fileName); }
public virtual void RetrieveStreamByMalformedResourceNameTest() { String fileName = "resourceResolverTest .png"; ResourceResolver resourceResolver = new ResourceResolver(baseUri); byte[] bytes = resourceResolver.RetrieveStream(fileName); Assert.Null(bytes); }
public virtual void RetrieveStreamTest() { String fileName = "resourceResolverTest.png"; byte[] expected = File.ReadAllBytes(baseUri + fileName); ResourceResolver resourceResolver = new ResourceResolver(baseUri); byte[] stream = resourceResolver.RetrieveStream("resourceResolverTest.png"); NUnit.Framework.Assert.NotNull(stream); NUnit.Framework.Assert.AreEqual(expected.Length, stream.Length); }