Exemplo n.º 1
0
        private static void TestProfileValues(IEightBimProfile profile)
        {
            Assert.IsNotNull(profile);

            Assert.AreEqual(25, profile.Values.Count());

            var firstValue = profile.Values.First();

            Assert.AreEqual(1061, firstValue.ID);

            byte[] bytes = new byte[16] {
                154, 137, 173, 93, 40, 109, 186, 33, 2, 200, 203, 169, 103, 5, 63, 219
            };
            CollectionAssert.AreEqual(bytes, firstValue.ToByteArray());

            foreach (var value in profile.Values)
            {
                Assert.IsNotNull(value.ToByteArray());
            }
        }
Exemplo n.º 2
0
        private static void TestProfile(IEightBimProfile profile)
        {
            Assert.IsNotNull(profile);

            Assert.AreEqual(2, profile.ClipPaths.Count());

            var first = profile.ClipPaths.First();

            Assert.AreEqual("Path 1", first.Name);
            XDocument doc = XDocument.Load(first.Path.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));

            var second = profile.ClipPaths.Skip(1).First();

            Assert.AreEqual("Path 2", second.Name);
            doc = XDocument.Load(second.Path.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));
        }