Пример #1
0
        public void ShouldProxyBaseConstructors()
        {
            var type = AspectFactory.CreateProxyType <IUserRepository>(typeof(UserRepository));

            IList <User> users = new[] { new User {
                                             Id = Guid.NewGuid(), Name = "Name"
                                         } };
            IUserRepository userRepository = (IUserRepository)Activator.CreateInstance(type, users);
            var             user           = userRepository.GetById(users[0].Id);

            Assert.AreEqual(users[0], user);
        }