Example #1
0
        public void GetPrimaryOwner()
        {
            var owner = new Member { FirstName = "Mary", LastName = "Smith" };
              var animal = new Animal();

              animal.Owners.Add(new AnimalOwner { Animal = animal, Owner = new Member { FirstName = "Joe", LastName = "Smith" } });
              animal.Owners.Add(new AnimalOwner { Animal = animal, Owner = owner, IsPrimary = true });

              var primary = animal.GetPrimaryOwner();
              Assert.AreSame(owner, primary);
        }
Example #2
0
 public void GetPrimaryOwner_none()
 {
     var animal = new Animal();
       Assert.IsNull(animal.GetPrimaryOwner());
 }