public void Markers_are_transient_per_implementation_method()
        {
            var interceptor = new MethodInvocationInterceptor();
            var a = this.factory.CreateInterfaceProxyWithTarget<ITester>(new Tester(), interceptor);
            var b = this.factory.CreateInterfaceProxyWithTarget<ITester>(new Tester2(), interceptor);
            a.Method1();
            b.Method1();

            Assert.That(interceptor.GetMarkers().Count, Is.EqualTo(2));
        }
        public void Each_marker_is_transient_per_method()
        {
            var interceptor = new MethodInvocationInterceptor();
            var tester = this.factory.CreateClassProxy<Tester>(interceptor);
            tester.Method1();
            tester.Method2();
            tester.Method3();

            var markers = interceptor.GetMarkers();
            Assert.That(markers.Count, Is.EqualTo(3));
            Assert.That(markers.Count(x => x.Value.LoggerLevel == LoggerLevel.Fatal), Is.EqualTo(1));

            AssertNotAllSame(markers.Select(x => x.Value).ToArray());
        }
        public void DefaultMarkerInstance_is_used_to_clone_new_instances()
        {
            var interceptor = new MethodInvocationInterceptor
            {
                DefaultMarkerInstance = new WithMethodInvocationAttribute
                {
                    LoggerLevel = LoggerLevel.Fatal
                }
            };
            var tester = this.factory.CreateClassProxy<Tester>(interceptor);
            tester.Method1();
            tester.Method2();
            tester.Method3();
            var markers = interceptor.GetMarkers();
            Assert.That(markers.Count, Is.EqualTo(3));
            Assert.That(markers.Count(x => x.Value.LoggerLevel == LoggerLevel.Fatal), Is.EqualTo(3));

            AssertNotAllSame(markers.Select(x => x.Value).ToArray());
        }