//=========================================================================================== private static void TestProfileValues(EightBimProfile profile) { Assert.IsNotNull(profile); Assert.AreEqual(25, profile.Values.Count()); foreach (EightBimValue value in profile.Values) { Assert.IsNotNull(value.ToByteArray()); } }
//=========================================================================================== private static void TestProfile(EightBimProfile profile) { Assert.IsNotNull(profile); Assert.AreEqual(2, profile.ClippingPaths.Count()); IXPathNavigable first = profile.ClippingPaths.First(); XDocument doc = XDocument.Load(first.CreateNavigator().ReadSubtree()); Assert.AreEqual(@"<svg width=""200"" height=""200""><g><path fill=""#00000000"" stroke=""#00000000"" stroke-width=""0"" stroke-antialiasing=""false"" d=""M 45 58
L 80 124
L 147 147
L 45 147
L 45 58 Z
"" /></g></svg>", doc.ToString(SaveOptions.DisableFormatting)); IXPathNavigable second = profile.ClippingPaths.Skip(1).First(); doc = XDocument.Load(second.CreateNavigator().ReadSubtree()); Assert.AreEqual(@"<svg width=""200"" height=""200""><g><path fill=""#00000000"" stroke=""#00000000"" stroke-width=""0"" stroke-antialiasing=""false"" d=""M 52 144
L 130 57
L 157 121
L 131 106
L 52 144 Z
"" /></g></svg>", doc.ToString(SaveOptions.DisableFormatting)); }
public void Test_IEquatable() { using (MagickImage image = new MagickImage(Files.FujiFilmFinePixS1ProJPG)) { ImageProfile first = image.GetExifProfile(); Assert.IsFalse(first == null); Assert.IsFalse(first.Equals(null)); Assert.IsTrue(first.Equals(first)); Assert.IsTrue(first.Equals((object)first)); ImageProfile second = image.GetExifProfile(); Assert.IsNotNull(second); Assert.IsTrue(first == second); Assert.IsTrue(first.Equals(second)); Assert.IsTrue(first.Equals((object)second)); second = new EightBimProfile(new byte[] { 0 }); Assert.IsTrue(first != second); Assert.IsFalse(first.Equals(second)); } }