public IGroup CreateGroup()
 {
     IGroup group;
     if (CreateGroupDelegate == null)
     {
         group = new SparkGroup();
     }
     else
     {
         group = CreateGroupDelegate();
     }
     return group;
 }
Esempio n. 2
0
        public void Read__Reading_A_Valid_Layer()
        {
            group = new SparkGroup();
            group.Read(File.ReadAllBytes("Content/Tests/Group/Group-Data.bin"));

            Assert.AreEqual("Group Name", group.Name);
            Assert.AreEqual(1, group.Id);
            Assert.AreEqual(0, group.Unknown);
            Assert.AreEqual(0xCC, group.Color.Red);
            Assert.AreEqual(0x99, group.Color.Green);
            Assert.AreEqual(0xFF, group.Color.Blue);
            Assert.AreEqual(0xAA, group.Color.Alpha);
        }
Esempio n. 3
0
        public void Write__Writting_A_Valid_Layer()
        {
            group = new SparkGroup();

            group.Id = 1;
            group.Name = "Group Name";
            group.Color = new ColorRgba(0xCC, 0x99, 0xFF, 0xAA);

            byte[] writtenData = group.Write();
            byte[] expected = File.ReadAllBytes("Content/Tests/Group/Group-Data.bin");

            Assert.AreEqual(BitConverter.ToString(expected), BitConverter.ToString(writtenData));
        }
Esempio n. 4
0
        public void Constructor__Set_Color_To_An_Instance()
        {
            group = new SparkGroup();

            Assert.IsNotNull(group.Color);
        }