Пример #1
0
        public void assign_a_given_id_setter_is_private()
        {
            var member      = ReflectionHelper.GetProperty <UserWithPrivateId>(x => x.Id);
            var theAssigner = new IdAssigner <UserWithPrivateId, Guid>(member, new GuidIdGeneration());
            var user        = new UserWithPrivateId();
            var id          = Guid.NewGuid();

            theAssigner.Assign(null, user, id);

            user.Id.ShouldBe(id);
        }
Пример #2
0
        public void assign_a_given_id_setter_is_private()
        {
            var member = ReflectionHelper.GetProperty<UserWithPrivateId>(x => x.Id);
            var theAssigner = new IdAssigner<UserWithPrivateId, Guid>(member, new GuidIdGeneration(), null);
            var user = new UserWithPrivateId();
            var id = Guid.NewGuid();

            theAssigner.Assign(user, id);

            user.Id.ShouldBe(id);
        }
Пример #3
0
        public IdAssignerTests()
        {
            var member = ReflectionHelper.GetProperty <User>(x => x.Id);

            theAssigner = new IdAssigner <User, Guid>(member, new GuidIdGeneration());
        }
Пример #4
0
 public IdAssignerTests()
 {
     var member = ReflectionHelper.GetProperty<User>(x => x.Id);
     theAssigner = new IdAssigner<User, Guid>(member, new GuidIdGeneration(), null);
 }