Exemple #1
0
        protected void ShouldHaveBytes(IStreamingItem streamingItem, byte[] bytes,
                                       StreamingCondition condition = default(StreamingCondition))
        {
            StreamingItemInfo streamingItemInfo = null;

            byte[] actualBytes = null;

            using (var ms = new MemoryStream())
            {
                streamingItem.ReadInto((properties, stream) =>
                {
                    stream.CopyTo(ms);
                    actualBytes       = ms.ToArray();
                    streamingItemInfo = properties;
                }, condition);
            }
            Assert.AreEqual(bytes, actualBytes);
            Assert.That(streamingItemInfo.ETag, Is.Not.Empty);
        }
Exemple #2
0
        protected void ShouldHaveGuid(IStreamingItem streamingItem, Guid g,
                                      StreamingCondition condition = default(StreamingCondition))
        {
            var  set    = false;
            Guid actual = Guid.Empty;
            StreamingItemInfo streamingItemInfo = null;

            streamingItem.ReadInto((properties, stream) =>
            {
                var b = new byte[16];
                stream.Read(b, 0, 16);
                actual            = new Guid(b);
                set               = true;
                streamingItemInfo = properties;
            }, condition);

            Assert.AreEqual(g, actual);

            Assert.That(streamingItemInfo.ETag, Is.Not.Empty);

            set = true;

            Assert.IsTrue(set);
        }