示例#1
0
        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);
        }
示例#2
0
        public virtual void malformedResourceNameTest()
        {
            String           fileName         = "resourceResolverTest .png";
            ResourceResolver resourceResolver = new ResourceResolver(baseUri);

            resourceResolver.RetrieveStream(fileName);
        }
示例#3
0
        public virtual void RetrieveStreamByMalformedResourceNameTest()
        {
            String           fileName         = "resourceResolverTest .png";
            ResourceResolver resourceResolver = new ResourceResolver(baseUri);

            byte[] bytes = resourceResolver.RetrieveStream(fileName);
            Assert.Null(bytes);
        }
示例#4
0
        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);
        }