示例#1
0
        public void TestAdoptionBefore20days()
        {
            Shelter theShelter = new Shelter("Fontys", "NL", 0123456, "*****@*****.**");
            Cat     a          = new Cat("ha2910", "pretty", "Fontys", "4 years", DateTime.Now);
            Owner   o          = new Owner("le", "a");
            decimal fee        = 0;

            theShelter.AddAnimal(a);
            theShelter.AddOwner(o);
            Assert.AreEqual(a.Adopt(o, ref fee), false);
        }
示例#2
0
        public void TestAdoptionAfter20daysWithNewOwner()
        {
            Shelter  theShelter = new Shelter("Fontys", "NL", 0123456, "*****@*****.**");
            DateTime value      = new DateTime(2018, 1, 18);
            Cat      a          = new Cat("ha2910", "pretty", "Fontys", "4 years", value);
            Owner    o          = new Owner("le", "a");
            decimal  fee        = 0;

            theShelter.AddAnimal(a);
            theShelter.AddOwner(o);
            Assert.AreEqual(a.Adopt(o, ref fee), true);
        }
示例#3
0
        public void TestClaimingAfterAdoptionfromNewOwner()
        {
            Shelter  theShelter = new Shelter("Fontys", "NL", 0123456, "*****@*****.**");
            DateTime value      = new DateTime(2018, 9, 8);
            Cat      a          = new Cat("ha2910", "pretty", "Fontys", "4 years", value);
            Owner    o          = new Owner("le", "a");

            decimal fee = 0;

            theShelter.AddAnimal(a);
            theShelter.AddOwner(o);
            a.UpdateOwner(o);

            a.Adopt(new Owner("N", "b"), ref fee);
            Assert.AreEqual(a.Claim(o, ref fee), false);
        }