public static void AreEqual(DefineShapeTag expected, DefineShapeTag actual) { Assert.AreEqual(expected.ShapeID, actual.ShapeID); AssertData.AreEqual(expected.ShapeBounds, actual.ShapeBounds, "ShapeBounds"); Assert.AreEqual(expected.FillStyles.Count, actual.FillStyles.Count, "FillStyles.Count"); for (var i = 0; i < expected.FillStyles.Count; i++) { var exp = expected.FillStyles[i]; var act = actual.FillStyles[i]; AssertFillStyles.AreEqual(exp, act, "FillStyles[" + i + "]"); } Assert.AreEqual(expected.LineStyles.Count, actual.LineStyles.Count, "LineStyles.Count"); for (var i = 0; i < expected.LineStyles.Count; i++) { var exp = expected.LineStyles[i]; var act = actual.LineStyles[i]; AssertShape.AreEqual(exp, act, "LineStyles[" + i + "]"); } Assert.AreEqual(expected.ShapeRecords.Count, actual.ShapeRecords.Count, "ShapeRecords.Count"); for (var i = 0; i < expected.ShapeRecords.Count; i++) { var exp = expected.ShapeRecords[i]; var act = actual.ShapeRecords[i]; AssertShape.AreEqual(exp, act, "ShapeRecords[" + i + "]"); } Assert.AreEqual(expected.RestData, actual.RestData); }
public static void AreEqual(BitmapFillStyleRGBA expected, BitmapFillStyleRGBA actual, string message) { Assert.AreEqual(expected.Mode, actual.Mode, message + ".Mode"); Assert.AreEqual(expected.Smoothing, actual.Smoothing, message + ".Smoothing"); Assert.AreEqual(expected.BitmapID, actual.BitmapID, "BitmapID"); AssertData.AreEqual(expected.BitmapMatrix, actual.BitmapMatrix, "BitmapMatrix"); }
public void ReadColorTransformRGBAFromBitsMultAddTest() { var mem = new MemoryStream(); WriteBits(mem, "1", "1", "1001", "0.00001010", "1.11110110", "0.11100000", "0.10110000", "1.11110111", "0.10000001", "0.00010000", "0.00001111"); var reader = new SwfStreamReader(mem); ColorTransformRGBA color; reader.ReadColorTransformRGBA(out color); Assert.AreEqual(mem.Length, mem.Position, "Should reach end of the stream"); AssertData.AreEqual(new ColorTransformRGBA { HasAddTerms = true, HasMultTerms = true, RedMultTerm = 10, GreenMultTerm = -10, BlueMultTerm = 224, AlphaMultTerm = 176, RedAddTerm = -9, GreenAddTerm = 129, BlueAddTerm = 16, AlphaAddTerm = 15 }, color, "ColorTransform"); }
public static void AreEqual(PlaceObject3Tag expected, PlaceObject3Tag actual) { Assert.AreEqual(expected.CharacterID, actual.CharacterID); Assert.AreEqual(expected.Depth, actual.Depth); AssertData.AreEqual(expected.Matrix, actual.Matrix, "Matrix"); AssertFilters.AreEqual(expected.Filters, actual.Filters, "PlaceObject3.Filters"); Assert.AreEqual(expected.RestData, actual.RestData); }
public static void AreEqual(PlaceObject2Tag expected, PlaceObject2Tag actual) { Assert.AreEqual(expected.CharacterID, actual.CharacterID); Assert.AreEqual(expected.Depth, actual.Depth); AssertData.AreEqual(expected.Matrix, actual.Matrix, "Matrix"); Assert.AreEqual(expected.HasColorTransform, actual.HasColorTransform, "HasColorTransform"); AssertData.AreEqual(expected.ColorTransform, actual.ColorTransform, "ColorTransform"); Assert.AreEqual(expected.RestData, actual.RestData); }
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"); }
public static void AreEqual(LinearGradientFillStyleRGBA expected, LinearGradientFillStyleRGBA actual, string message) { AssertData.AreEqual(expected.GradientMatrix, actual.GradientMatrix, message); AssertGradients.AreEqual(expected.Gradient, actual.Gradient, message + ".Gradient"); }