public void IsUsedTest()
        {
            LayoutPos target = new LayoutPos() { Group = 1, TypeId = 2, Id = 3 };
            Assert.IsTrue(target.IsUsed);

            LayoutPos target2 = new LayoutPos() { Group = 1, TypeId = 1, Id = 3 };
            Assert.IsFalse(target2.IsUsed);
        }
 public void CloneTest()
 {
     LayoutPos original = new LayoutPos() { Group = 1, TypeId = 2, Id = 3 };
     LayoutPos clone = original.Clone();
     Assert.AreEqual(original.Group, 1);
     Assert.AreEqual(original.TypeId, 2);
     Assert.AreEqual(original.Id, 3);
     Assert.AreEqual(original.Group, clone.Group);
     Assert.AreEqual(original.TypeId, clone.TypeId);
     Assert.AreEqual(original.Id, clone.Id);
 }
        public void CloneTest()
        {
            LayoutPos layoutPos = new LayoutPos() { Group = 1, TypeId = 2, Id = 3 };
            Color colour = new Color() { R = 255, G = 0, B = 128 };
            string hoverText = "hover text";
            LayoutPosEditor original = new LayoutPosEditor(layoutPos, colour, hoverText); // TODO: Initialize to an appropriate value
            LayoutPosEditor copy = original.Clone();
            Assert.AreEqual(copy.LayoutPos.Id, original.LayoutPos.Id);
            Assert.AreEqual(copy.LayoutPos.Group, original.LayoutPos.Group);
            Assert.AreEqual(copy.LayoutPos.TypeId, original.LayoutPos.TypeId);

            Assert.AreEqual(copy.Colour, original.Colour);
            Assert.AreEqual(copy.HoverText, original.HoverText);

            Assert.IsTrue(copy.IsVisuallyEqual(original));
        }
 public LayoutPosEditor(LayoutPos layoutPos, Color colour, string hoverText)
 {
     this.layoutPos = layoutPos;
     this.colour = colour;
     this.hoverText = hoverText;
 }
        private void ModifyLayoutPosEditorForPosition(LayoutPos layoutPos, ref LayoutPosEditor layoutPosEditor, FillSettingsModel fillSettings)
        {
            layoutPosEditor.LayoutPos = layoutPos;
            SampleType sampleType = fillSettings.GetSampleTypeById(layoutPos.TypeId);

            string hoverText = string.Empty;
            if (layoutPos.IsUsed)
            {
                hoverText = string.Format("{0}{1}", sampleType.Name, layoutPos.Group);
            }
            layoutPosEditor.HoverText = hoverText;
            layoutPosEditor.Colour = ColourTransformer.GetColorFromName(sampleType.Colour);
        }