public void Assign_body() { LoadStyleSheet("Styles.body.css"); var mockControl = new LayoutableFake("body"); _styleSheet.Assign(mockControl); var styles = _styleSheet.GetStyles(mockControl); Assert.AreEqual("#ff0000", FindStyle <BackgroundColor>(styles).Value.ToString()); }
public void Assign_ReassignControl_ChangeState() { LoadStyleSheet("Styles.for_reassign.css"); var button = new LayoutableFake("Button", "old-style"); var body = new ContainerFake("body").Add(button); // prepare styles _styleSheet.Assign(body); // check var styles = _styleSheet.GetStyles(button); Assert.AreEqual("#f00", FindStyle <TextColor>(styles).Value.ToString()); // reassign button.CssClass = "new-style"; _styleSheet.Assign(button); // check styles = _styleSheet.GetStyles(button); Assert.AreEqual("#0f0", FindStyle <TextColor>(styles).Value.ToString()); }