public void MulticastPoco()
        {
            var testingPoco = new TestingEventPoco();

            testingPoco.MyEvent += TestingListener.AnotherStandardCallback;
            testingPoco.MyEvent += TestingListener.StandardCallback;
            EventApprovals.VerifyEvents(testingPoco);
        }
Exemple #2
0
        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);
        }
Exemple #4
0
 public void ComponentWithStandardEventHandler()
 {
     using (ApprovalTests.Namers.ApprovalResults.UniqueForOs()) {
         var timer = new Timer();
         timer.Tick += TestingListener.StandardCallback;
         timer.Tick += TestingListener.AnotherStandardCallback;
         EventApprovals.VerifyEvents(timer);
     }
 }
Exemple #5
0
        public void ControlWithLocalAndBaseKeys()
        {
            var checkBox = new CheckBox();

            checkBox.CheckedChanged += TestingListener.AnotherStandardCallback;
            checkBox.Click          += TestingListener.AnotherStandardCallback;
            checkBox.Click          += TestingListener.StandardCallback;
            EventApprovals.VerifyEvents(checkBox);
        }
Exemple #6
0
 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);
     }
 }
Exemple #7
0
        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);
        }
Exemple #8
0
        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());
        }
Exemple #9
0
 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);
     }
 }
Exemple #10
0
 private static IEnumerable <object> GetSubEvents(Form form)
 {
     return(form.GetInstanceFields()
            .Select(fi => fi.GetValue(form))
            .Where(o => EventApprovals.GetEventsInformationFor(o).Count() > 0));
 }