public void ReadEmptyColorTransformTest() { var mem = new MemoryStream(new byte[] { 0 }); var reader = new SwfStreamReader(mem); var transform = reader.ReadColorTransformRGB(); Assert.IsFalse(transform.HasAddTerms); Assert.IsFalse(transform.HasMultTerms); }
public void ReadColorTransformRGBFromBitsAddTest() { var mem = new MemoryStream(); WriteBits(mem, "1", "0", "1001", "0.00001010", "1.11110110", "0.11100000"); var reader = new SwfStreamReader(mem); var color = reader.ReadColorTransformRGB(); Assert.AreEqual(mem.Length, mem.Position, "Should reach end of the stream"); AssertData.AreEqual(new ColorTransformRGB { HasAddTerms = true, HasMultTerms = false, RedAddTerm = 10, GreenAddTerm = -10, BlueAddTerm = 224 }, color, "ColorTransform"); }