Ejemplo n.º 1
0
        private void ConstructorStreamTest(bool xmlDebugging)
        {
            MemoryStream s = CreateStream();

            // Extra stuff not included in the frame stream, to pass to the
            // constructor.
            ColourTable             colourTable = WikipediaExample.GlobalColourTable;
            GraphicControlExtension ext         = WikipediaExample.GraphicControlExtension;
            LogicalScreenDescriptor lsd         = WikipediaExample.LogicalScreenDescriptor;

            _frame = new GifFrame(s, lsd, colourTable, ext, null, null, xmlDebugging);

            Assert.AreEqual(ErrorState.Ok, _frame.ConsolidatedState);

            WikipediaExample.CheckImage(_frame.TheImage);
            WikipediaExample.CheckImageDescriptor(_frame.ImageDescriptor);
            WikipediaExample.CheckGraphicControlExtension(_frame.GraphicControlExtension);
            WikipediaExample.CheckImageData(_frame.IndexedPixels);
            Assert.AreEqual(0, _frame.BackgroundColour.R);
            Assert.AreEqual(0, _frame.BackgroundColour.G);
            Assert.AreEqual(0, _frame.BackgroundColour.B);

            if (xmlDebugging)
            {
                Assert.AreEqual(ExpectedDebugXml, _frame.DebugXml);
            }
        }