public void AddSingleBehavior() { var style = new Style <Label>(); Style?formsStyle = style; Assume.That(formsStyle?.Behaviors?.Count ?? 0, Is.EqualTo(0)); var behavior = new LabelBehavior(); style.Add(behavior); Assert.That(formsStyle?.Behaviors?.Count, Is.EqualTo(1)); Assert.That(ReferenceEquals(formsStyle?.Behaviors?[0], behavior)); }
public void AddMultipleBehaviors() { var style = new Style <Label>(); Style?formsStyle = style; Assume.That(formsStyle?.Behaviors?.Count ?? 0, Is.EqualTo(0)); var behavior1 = new LabelBehavior(); var behavior2 = new LabelBehavior(); style.Add(behavior1, behavior2); Assert.That(formsStyle?.Behaviors?.Count, Is.EqualTo(2)); Assert.That(ReferenceEquals(formsStyle?.Behaviors?[0], behavior1)); Assert.That(ReferenceEquals(formsStyle?.Behaviors?[1], behavior2)); }