Ejemplo n.º 1
0
        public void assign_a_given_id()
        {
            var user = new User();
            var id   = Guid.NewGuid();

            theAssigner.Assign(null, user, id);

            user.Id.ShouldBe(id);
        }
Ejemplo n.º 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());
            var user        = new UserWithPrivateId();
            var id          = Guid.NewGuid();

            theAssigner.Assign(null, user, id);

            user.Id.ShouldBe(id);
        }
Ejemplo n.º 3
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);
        }