Ejemplo n.º 1
0
        public void CreatePersonOfferor_ShouldThrow()
        {
            var personOfferor = new PersonOfferor();

            personOfferor.Person = null;

            Assert.ThrowsAny <Exception>(() => personOfferor.ValidateObject());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PersonOfferorService"/> class.
        /// </summary>
        /// <param name="offeror">The offer person.</param>
        public PersonOfferorService(PersonOfferor offeror)
        {
            offeror.ValidateObject();

            this.Offeror = offeror;

            this.UpdateIsBanned();
        }
Ejemplo n.º 3
0
        public void CreatePersonOfferor_ShouldThrowBadId(int id)
        {
            var personOfferor = new PersonOfferor {
                IdOfferor      = id,
                LastBannedDate = DateTime.Now,
                Person         = new Person()
            };

            Assert.ThrowsAny <Exception>(() => personOfferor.ValidateObject());
        }
Ejemplo n.º 4
0
        public void CreatePersonOfferor_ShouldInstantiatePersonOfferor()
        {
            Person person        = new Person();
            var    personOfferor = new PersonOfferor();

            personOfferor.Person = person;

            personOfferor.ValidateObject();
            Assert.NotNull(personOfferor);
        }