public void CreatePersonOfferor_ShouldThrow() { var personOfferor = new PersonOfferor(); personOfferor.Person = null; Assert.ThrowsAny <Exception>(() => personOfferor.ValidateObject()); }
/// <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(); }
public void CreatePersonOfferor_ShouldThrowBadId(int id) { var personOfferor = new PersonOfferor { IdOfferor = id, LastBannedDate = DateTime.Now, Person = new Person() }; Assert.ThrowsAny <Exception>(() => personOfferor.ValidateObject()); }
public void CreatePersonOfferor_ShouldInstantiatePersonOfferor() { Person person = new Person(); var personOfferor = new PersonOfferor(); personOfferor.Person = person; personOfferor.ValidateObject(); Assert.NotNull(personOfferor); }