public void MulticastPoco() { var testingPoco = new TestingEventPoco(); testingPoco.MyEvent += TestingListener.AnotherStandardCallback; testingPoco.MyEvent += TestingListener.StandardCallback; EventApprovals.VerifyEvents(testingPoco); }
public void ComponentWithStandardEventHandler() { var timer = new Timer(); timer.Tick += TestingListener.StandardCallback; timer.Tick += TestingListener.AnotherStandardCallback; EventApprovals.VerifyEvents(timer); }
public void UnicastPoco() { var testingPoco = new TestingEventPoco(); testingPoco.MyEvent += TestingListener.StandardCallback; testingPoco.PropertyChanged += TestingListener.PropertyChangedCallback; EventApprovals.VerifyEvents(testingPoco); }
public void ComponentWithStandardEventHandler() { using (ApprovalTests.Namers.ApprovalResults.UniqueForOs()) { var timer = new Timer(); timer.Tick += TestingListener.StandardCallback; timer.Tick += TestingListener.AnotherStandardCallback; EventApprovals.VerifyEvents(timer); } }
public void ControlWithLocalAndBaseKeys() { var checkBox = new CheckBox(); checkBox.CheckedChanged += TestingListener.AnotherStandardCallback; checkBox.Click += TestingListener.AnotherStandardCallback; checkBox.Click += TestingListener.StandardCallback; EventApprovals.VerifyEvents(checkBox); }
public void ControlWithLocalAndBaseKeys() { using (ApprovalTests.Namers.ApprovalResults.UniqueForOs()) { var checkBox = new CheckBox(); checkBox.CheckedChanged += TestingListener.AnotherStandardCallback; checkBox.Click += TestingListener.AnotherStandardCallback; checkBox.Click += TestingListener.StandardCallback; EventApprovals.VerifyEvents(checkBox); } }
public void ControlWithEverything() { var testingControl = new TestingControl(); testingControl.Click += TestingListener.StandardCallback; testingControl.Click += TestingListener.AnotherStandardCallback; testingControl.MyEvent += TestingListener.StandardCallback; testingControl.MyEvent += TestingListener.AnotherStandardCallback; testingControl.KeyEvent += TestingListener.StandardCallback; testingControl.KeyEvent += TestingListener.AnotherStandardCallback; EventApprovals.VerifyEvents(testingControl); }
public static void VerifyEventsFor(Form form) { var sb = new StringBuilder(); sb.Append(EventApprovals.WriteEventsToString(form, "")); foreach (var o in GetSubEvents(form)) { sb.Append(EventApprovals.WriteEventsToString(o, GetLabelForChild(form, o))); } Approvals.Verify(sb.ToString()); }
public void ControlWithEverything() { using (ApprovalTests.Namers.ApprovalResults.UniqueForOs()) { var testingControl = new TestingControl(); testingControl.Click += TestingListener.StandardCallback; testingControl.Click += TestingListener.AnotherStandardCallback; testingControl.MyEvent += TestingListener.StandardCallback; testingControl.MyEvent += TestingListener.AnotherStandardCallback; testingControl.KeyEvent += TestingListener.StandardCallback; testingControl.KeyEvent += TestingListener.AnotherStandardCallback; EventApprovals.VerifyEvents(testingControl); } }
private static IEnumerable <object> GetSubEvents(Form form) { return(form.GetInstanceFields() .Select(fi => fi.GetValue(form)) .Where(o => EventApprovals.GetEventsInformationFor(o).Count() > 0)); }