public void MethodsNamedApplyAreIgnored()
            {
                var attribute = new ApplyByConventionAttribute {
                    PublicOnly = true
                };
                var applyMethods = attribute.GetApplyMethods(typeof(FakeAggregate));

                Assert.Equal(0, applyMethods.Count);
            }
            public void PropagateSettingToApplyMethodCollection(Boolean applyOptional)
            {
                var attribute = new ApplyByConventionAttribute {
                    ApplyOptional = applyOptional
                };
                var applyMethods = attribute.GetApplyMethods(typeof(FakeAggregate));

                Assert.Equal(applyOptional, applyMethods.ApplyOptional);
            }
            public void MethodsMatchingCustomNameAreIncluded()
            {
                var attribute = new ApplyByConventionAttribute {
                    PublicOnly = false
                };
                var applyMethods = attribute.GetApplyMethods(typeof(FakeAggregate));

                Assert.Equal(1, applyMethods.Count);
            }
            public void MethodsMatchingCustomNameAreIncluded()
            {
                var attribute = new ApplyByConventionAttribute { MethodName = "Custom" };
                var applyMethods = attribute.GetApplyMethods(typeof(FakeAggregate));
                var applyMethod = applyMethods.Single().Value;
                var aggregate = new FakeAggregate();

                applyMethod(aggregate, new FakeEvent());

                Assert.True(aggregate.Handled);
            }
            public void MethodsMatchingCustomNameAreIncluded()
            {
                var attribute = new ApplyByConventionAttribute {
                    MethodName = "Custom"
                };
                var applyMethods = attribute.GetApplyMethods(typeof(FakeAggregate));
                var applyMethod  = applyMethods.Single().Value;
                var aggregate    = new FakeAggregate();

                applyMethod(aggregate, new FakeEvent());

                Assert.True(aggregate.Handled);
            }
            public void MethodsMatchingCustomNameAreIncluded()
            {
                var attribute = new ApplyByConventionAttribute { PublicOnly = false };
                var applyMethods = attribute.GetApplyMethods(typeof(FakeAggregate));

                Assert.Equal(1, applyMethods.Count);
            }
            public void MethodsNamedApplyAreIgnored()
            {
                var attribute = new ApplyByConventionAttribute { PublicOnly = true };
                var applyMethods = attribute.GetApplyMethods(typeof(FakeAggregate));

                Assert.Equal(0, applyMethods.Count);
            }
            public void PropagateSettingToApplyMethodCollection(Boolean applyOptional)
            {
                var attribute = new ApplyByConventionAttribute { ApplyOptional = applyOptional };
                var applyMethods = attribute.GetApplyMethods(typeof(FakeAggregate));

                Assert.Equal(applyOptional, applyMethods.ApplyOptional);
            }