public void TextVisualUnderline() { tlog.Debug(tag, $"TextVisualUnderline START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); PropertyMap underlineMapSet = new PropertyMap(); underlineMapSet.Add("enable", new PropertyValue("true")); underlineMapSet.Add("color", new PropertyValue("green")); underlineMapSet.Add("height", new PropertyValue("1")); testingTarget.Underline = underlineMapSet; PropertyMap underlineMapGet = new PropertyMap(); underlineMapGet = testingTarget.Underline; Assert.IsNotNull(underlineMapGet, "Should not be null"); string str = ""; underlineMapGet["enable"].Get(out str); Assert.AreEqual("true", str, "Retrieved enable should equals to the set value"); underlineMapGet["color"].Get(out str); Assert.AreEqual("green", str, "Retrieved color should equals to the set value"); underlineMapGet["height"].Get(out str); Assert.AreEqual("1", str, "Retrieved height should equals to the set value"); underlineMapGet.Dispose(); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualUnderline END (OK)"); }
public void TextVisualConstructor() { tlog.Debug(tag, $"TextVisualConstructor START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualConstructor END (OK)"); }
public void TextVisualFontFamily() { tlog.Debug(tag, $"TextVisualFontFamily START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); testingTarget.FontFamily = "FontFamily"; Assert.AreEqual("FontFamily", testingTarget.FontFamily, "Retrieved FontFamily should be equal to set value"); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualFontFamily END (OK)"); }
public void TextVisualPointSize() { tlog.Debug(tag, $"TextVisualPointSize START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); testingTarget.PointSize = 1.0f; Assert.AreEqual(1.0f, testingTarget.PointSize, "Retrieved PointSize should be equal to set value"); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualPointSize END (OK)"); }
public void TextVisualEnableMarkup() { tlog.Debug(tag, $"TextVisualEnableMarkup START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); testingTarget.EnableMarkup = true; Assert.AreEqual(true, testingTarget.EnableMarkup, "Retrieved EnableMarkup should be equal to set value"); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualEnableMarkup END (OK)"); }
public void VisualMapVisualFittingModeWithNullMode() { tlog.Debug(tag, $"VisualMapVisualFittingModeWithNullMode START"); TextVisual tVisual = new TextVisual(); Assert.AreEqual(VisualFittingModeType.FitKeepAspectRatio, tVisual.VisualFittingMode, "should be equal!"); BorderVisual bvisual = new BorderVisual(); Assert.AreEqual(VisualFittingModeType.Fill, bvisual.VisualFittingMode, "should be equal!"); tVisual.Dispose(); bvisual.Dispose(); tlog.Debug(tag, $"VisualMapVisualFittingModeWithNullMode END (OK)"); }
public void TextVisualShadow() { tlog.Debug(tag, $"TextVisualShadow START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); PropertyMap shadowMapSet = new PropertyMap(); shadowMapSet.Add("color", new PropertyValue(new Color(1.0f, 0.1f, 0.3f, 0.5f))); shadowMapSet.Add("offset", new PropertyValue(new Vector2(2.0f, 1.0f))); shadowMapSet.Add("blurRadius", new PropertyValue(3.0f)); testingTarget.Shadow = shadowMapSet; PropertyMap shadowMapGet = new PropertyMap(); shadowMapGet = testingTarget.Shadow; Assert.IsNotNull(shadowMapGet, "Should not be null"); using (Color color = new Color()) { shadowMapGet["color"].Get(color); Assert.AreEqual(1.0f, color.R, "Retrieved color.R should be equal to set value"); Assert.AreEqual(0.1f, color.G, "Retrieved color.G should be equal to set value"); Assert.AreEqual(0.3f, color.B, "Retrieved color.B should be equal to set value"); Assert.AreEqual(0.5f, color.A, "Retrieved color.A should be equal to set value"); } using (Vector2 vector2 = new Vector2()) { shadowMapGet["offset"].Get(vector2); Assert.AreEqual(2.0f, vector2.X, "Retrieved vector2.X should be equal to set value"); Assert.AreEqual(1.0f, vector2.Y, "Retrieved vector2.Y should be equal to set value"); } float blurRadius; shadowMapGet["blurRadius"].Get(out blurRadius); Assert.AreEqual(3.0f, blurRadius, "Retrieved blurRadius should equals to the set value"); shadowMapSet.Dispose(); shadowMapGet.Dispose(); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualShadow END (OK)"); }
public void TextVisualTextColor() { tlog.Debug(tag, $"TextVisualTextColor START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); using (Color color = new Color(1.0f, 1.0f, 1.0f, 1.0f)) { testingTarget.TextColor = color; Assert.AreEqual(1.0f, testingTarget.TextColor.R, "Retrieved TextColor.R should be equal to set value"); Assert.AreEqual(1.0f, testingTarget.TextColor.G, "Retrieved TextColor.G should be equal to set value"); Assert.AreEqual(1.0f, testingTarget.TextColor.B, "Retrieved TextColor.B should be equal to set value"); Assert.AreEqual(1.0f, testingTarget.TextColor.A, "Retrieved TextColor.A should be equal to set value"); } testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualTextColor END (OK)"); }
public void TextVisualBackground() { tlog.Debug(tag, $"TextVisualBackground START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); PropertyMap backgroundMapSet = new PropertyMap(); backgroundMapSet.Add("enable", new PropertyValue(true)); backgroundMapSet.Add("color", new PropertyValue(new Color(1.0f, 0.1f, 0.3f, 0.5f))); testingTarget.Background = backgroundMapSet; PropertyMap backgroundMapGet = new PropertyMap(); backgroundMapGet = testingTarget.Background; Assert.IsNotNull(backgroundMapGet, "Should not be null"); bool enable = false; backgroundMapGet["enable"].Get(out enable); Assert.AreEqual(true, enable, "Retrieved enable should equals to the set value"); using (Color color = new Color()) { backgroundMapGet["color"].Get(color); Assert.AreEqual(1.0f, color.R, "Retrieved color.R should be equal to set value"); Assert.AreEqual(0.1f, color.G, "Retrieved color.G should be equal to set value"); Assert.AreEqual(0.3f, color.B, "Retrieved color.B should be equal to set value"); Assert.AreEqual(0.5f, color.A, "Retrieved color.A should be equal to set value"); } backgroundMapSet.Dispose(); backgroundMapGet.Dispose(); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualBackground END (OK)"); }
public void TextVisualOutline() { tlog.Debug(tag, $"TextVisualOutline START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); PropertyMap outlineMapSet = new PropertyMap(); outlineMapSet.Add("color", new PropertyValue(new Color(1.0f, 0.1f, 0.3f, 0.5f))); outlineMapSet.Add("width", new PropertyValue("1")); testingTarget.Outline = outlineMapSet; PropertyMap outlineMapGet = new PropertyMap(); outlineMapGet = testingTarget.Outline; Assert.IsNotNull(outlineMapGet, "Should not be null"); using (Color color = new Color()) { outlineMapGet["color"].Get(color); Assert.AreEqual(1.0f, color.R, "Retrieved color.R should be equal to set value"); Assert.AreEqual(0.1f, color.G, "Retrieved color.G should be equal to set value"); Assert.AreEqual(0.3f, color.B, "Retrieved color.B should be equal to set value"); Assert.AreEqual(0.5f, color.A, "Retrieved color.A should be equal to set value"); } string str = ""; outlineMapGet["width"].Get(out str); Assert.AreEqual("1", str, "Retrieved width should equals to the set value"); outlineMapSet.Dispose(); outlineMapGet.Dispose(); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualOutline END (OK)"); }
public void TextVisualVerticalAlignment() { tlog.Debug(tag, $"TextVisualVerticalAlignment START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); Assert.AreEqual(VerticalAlignment.Top, testingTarget.VerticalAlignment, "Retrieved VerticalAlignment should be equal to set value"); testingTarget.VerticalAlignment = VerticalAlignment.Center; Assert.AreEqual(VerticalAlignment.Center, testingTarget.VerticalAlignment, "Retrieved VerticalAlignment should be equal to set value"); testingTarget.VerticalAlignment = VerticalAlignment.Bottom; Assert.AreEqual(VerticalAlignment.Bottom, testingTarget.VerticalAlignment, "Retrieved VerticalAlignment should be equal to set value"); testingTarget.VerticalAlignment = VerticalAlignment.Top; Assert.AreEqual(VerticalAlignment.Top, testingTarget.VerticalAlignment, "Retrieved VerticalAlignment should be equal to set value"); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualVerticalAlignment END (OK)"); }
public void TextVisualHorizontalAlignment() { tlog.Debug(tag, $"TextVisualHorizontalAlignment START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); Assert.AreEqual(HorizontalAlignment.Begin, testingTarget.HorizontalAlignment, "Retrieved HorizontalAlignment should be equal to set value"); testingTarget.HorizontalAlignment = HorizontalAlignment.Center; Assert.AreEqual(HorizontalAlignment.Center, testingTarget.HorizontalAlignment, "Retrieved HorizontalAlignment should be equal to set value"); testingTarget.HorizontalAlignment = HorizontalAlignment.End; Assert.AreEqual(HorizontalAlignment.End, testingTarget.HorizontalAlignment, "Retrieved HorizontalAlignment should be equal to set value"); testingTarget.HorizontalAlignment = HorizontalAlignment.Begin; Assert.AreEqual(HorizontalAlignment.Begin, testingTarget.HorizontalAlignment, "Retrieved HorizontalAlignment should be equal to set value"); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualHorizontalAlignment END (OK)"); }
public void TextVisualFontStyle() { tlog.Debug(tag, $"TextVisualFontStyle START"); var testingTarget = new TextVisual(); Assert.IsNotNull(testingTarget, "Can't create success object TextVisual"); Assert.IsInstanceOf <TextVisual>(testingTarget, "Should be an instance of TextVisual type."); PropertyMap fontStyleMapSet = new PropertyMap(); fontStyleMapSet.Add("weight", new PropertyValue("bold")); fontStyleMapSet.Add("width", new PropertyValue("condensed")); fontStyleMapSet.Add("slant", new PropertyValue("italic")); testingTarget.FontStyle = fontStyleMapSet; PropertyMap fontStyleMapGet = new PropertyMap(); fontStyleMapGet = testingTarget.FontStyle; Assert.IsNotNull(fontStyleMapGet, "Should not be null"); string str = ""; fontStyleMapGet.Find(0, "weight").Get(out str); Assert.AreEqual("bold", str, "fontStyleMapGet.Find(\"weight\") should equals to the set value"); fontStyleMapGet.Find(1, "width").Get(out str); Assert.AreEqual("condensed", str, "fontStyleMapGet.Find(\"width\") should equals to the set value"); fontStyleMapGet.Find(2, "slant").Get(out str); Assert.AreEqual("italic", str, "fontStyleMapGet.Find(\"slant\") should equals to the set value"); fontStyleMapSet.Dispose(); fontStyleMapGet.Dispose(); testingTarget.Dispose(); tlog.Debug(tag, $"TextVisualFontStyle END (OK)"); }