コード例 #1
0
		//===========================================================================================
		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());
			}
		}
コード例 #2
0
		//===========================================================================================
		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&#xA;L 80 124&#xA;L 147 147&#xA;L 45 147&#xA;L 45 58 Z&#xA;"" /></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&#xA;L 130 57&#xA;L 157 121&#xA;L 131 106&#xA;L 52 144 Z&#xA;"" /></g></svg>", doc.ToString(SaveOptions.DisableFormatting));
		}
コード例 #3
0
		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));
			}
		}