public void Inherit_FontSize() { MockApplication app = MockApplication.Setup <StyleSetTestThing>(); StyleSetTestThing root = (StyleSetTestThing)app.RootElement; UIStyleSetStateProxy normal = root.style.Normal; normal.TextFontSize = 8; app.Update(); Assert.AreEqual(new UIFixedLength(8), root.FindById("group1").style.TextFontSize); Assert.AreEqual(new UIFixedLength(8), root.FindById("group2").style.TextFontSize); root.FindById("group1").style.SetTextFontSize(12, StyleState.Normal); app.Update(); Assert.AreEqual(new UIFixedLength(12), root.FindById("group1").style.TextFontSize); Assert.AreEqual(new UIFixedLength(12), root.FindById("group2").style.TextFontSize); root.FindById("group1").style.SetTextFontSize(null, StyleState.Normal); app.Update(); Assert.AreEqual(new UIFixedLength(8), root.FindById("group1").style.TextFontSize); Assert.AreEqual(new UIFixedLength(8), root.FindById("group2").style.TextFontSize); }
public void Inherit_TextColor() { MockApplication app = MockApplication.Setup <StyleSetTestThing>(); StyleSetTestThing root = (StyleSetTestThing)app.RootElement; UIStyleSetStateProxy normal = root.style.Normal; normal.TextColor = Color.red; app.Update(); Assert.AreEqual(Color.red, root.FindById("group1").style.TextColor); Assert.AreEqual(Color.red, root.FindById("group2").style.TextColor); root.FindById("group1").style.SetTextColor(Color.blue, StyleState.Normal); app.Update(); Assert.AreEqual(Color.blue, root.FindById("group1").style.TextColor); Assert.AreEqual(Color.blue, root.FindById("group2").style.TextColor); root.FindById("group1").style.SetTextColor(null, StyleState.Normal); app.Update(); Assert.AreEqual(Color.red, root.FindById("group1").style.TextColor); Assert.AreEqual(Color.red, root.FindById("group2").style.TextColor); }
public void Inherit_FontAsset() { MockApplication app = MockApplication.Setup <StyleSetTestThing>(); StyleSetTestThing root = (StyleSetTestThing)app.RootElement; UIStyleSetStateProxy normal = root.style.Normal; // var font0 = new FontAsset(TMP_FontAsset.defaultFontAsset); // var font1 = new FontAsset(TMP_FontAsset.defaultFontAsset); // normal.TextFontAsset = font0; // app.Update(); // Assert.AreEqual(font0, root.FindById("group1").style.TextFontAsset); // Assert.AreEqual(font0, root.FindById("group2").style.TextFontAsset); // root.FindById("group1").style.SetTextFontAsset(font1, StyleState.Normal); // app.Update(); // Assert.AreEqual(font1, root.FindById("group1").style.TextFontAsset); // Assert.AreEqual(font1, root.FindById("group2").style.TextFontAsset); // root.FindById("group1").style.SetTextFontAsset(null, StyleState.Normal); // app.Update(); // Assert.AreEqual(font0, root.FindById("group1").style.TextFontAsset); // Assert.AreEqual(font0, root.FindById("group2").style.TextFontAsset); }