示例#1
0
        public void Clone_Equal()
        {
            Person person1 = new Person(FULL_NAME, EMAIL);
            Person person2 = person1.Clone();

            Assert.AreEqual(person1, person2);
        }
示例#2
0
        public void Clone_NotSameObject()
        {
            Person person1 = new Person(FULL_NAME, EMAIL);
            Person person2 = person1.Clone();

            Assert.AreNotSame(person1, person2);
        }
        public void WouldBe_ValidPair()
        {
            Person person1 = new Person("Curtis Thibault", "Email");
            Person person2 = new Person("Jake Gamble", "Email");

            Assert.True(SecretSantaPair.WouldBeValid(person1, person2));
        }
示例#4
0
        static void Main(string[] args)
        {
            #region Problem 1
            //Problem1.Problem1.Run("CLEPK HHNIY CFPWH FDFEH", false);
            //Problem1.Problem1.Run("ABVAW LWZSY OORYK DUPVH", false);
            //Console.Read();
            #endregion Problem 1

            #region Problem 2
            Problem2.Person p1 = new Problem2.Person("Curtis Thibault", "test");

            List<Problem2.Person> list = new List<Problem2.Person>()
            {
                new Problem2.Person("Curtis Thibault", "email"),
                new Problem2.Person("Kara Thibault", "email"),
                new Problem2.Person("Kelly Shore", "email"),
                new Problem2.Person("Michele Shore", "email"),
                new Problem2.Person("Jake Gamble", "email"),
                new Problem2.Person("Jessica Gamble", "email"),
                new Problem2.Person("Ryan Shea", "email"),
                new Problem2.Person("Sharon Shea", "email")
            };

            for (int i = 0; i < 5; i++)
            {
                Problem2.SecretSantaPairer ssp = new Problem2.SecretSantaPairer(list);
                Console.Write(ssp.ToString());
                Console.Read();
                Console.Clear();
            }
            #endregion Problem 2
        }
示例#5
0
        static void Main(string[] args)
        {
            #region Problem 1
            //Problem1.Problem1.Run("CLEPK HHNIY CFPWH FDFEH", false);
            //Problem1.Problem1.Run("ABVAW LWZSY OORYK DUPVH", false);
            //Console.Read();
            #endregion Problem 1

            #region Problem 2
            Problem2.Person p1 = new Problem2.Person("Curtis Thibault", "test");

            List <Problem2.Person> list = new List <Problem2.Person>()
            {
                new Problem2.Person("Curtis Thibault", "email"),
                new Problem2.Person("Kara Thibault", "email"),
                new Problem2.Person("Kelly Shore", "email"),
                new Problem2.Person("Michele Shore", "email"),
                new Problem2.Person("Jake Gamble", "email"),
                new Problem2.Person("Jessica Gamble", "email"),
                new Problem2.Person("Ryan Shea", "email"),
                new Problem2.Person("Sharon Shea", "email")
            };

            for (int i = 0; i < 5; i++)
            {
                Problem2.SecretSantaPairer ssp = new Problem2.SecretSantaPairer(list);
                Console.Write(ssp.ToString());
                Console.Read();
                Console.Clear();
            }
            #endregion Problem 2
        }
        public void ValidPair()
        {
            Person person1 = new Person("Curtis Thibault", "Email");
            Person person2 = new Person("Jake Gamble", "Email");
            SecretSantaPair pair = new SecretSantaPair(person1, person2);

            Assert.True(pair.IsValid);
        }
        public void Receiver()
        {
            Person person1 = new Person("One Last", "Email");
            Person person2 = new Person("Two Last", "Email");
            SecretSantaPair pair = new SecretSantaPair(person1, person2);

            Assert.AreEqual(person2, pair.Receiver);
        }
        public void InvalidPair_SamePerson()
        {
            Person person1 = new Person("First Person", "Email");
            Person person2 = new Person("First Person", "Email");
            SecretSantaPair pair = new SecretSantaPair(person1, person2);

            Assert.False(pair.IsValid);
        }
示例#9
0
        public bool Equals(Person otherPerson)
        {
            if (otherPerson == null) return false;

            if (!FirstName.Equals(otherPerson.FirstName)) return false;
            if (!LastName.Equals(otherPerson.LastName)) return false;

            return true;
        }
        public static bool WouldBeValid(Person giver, Person receiver)
        {
            //Same Person?
            if (giver.Equals(receiver)) return false;

            //Same Family?
            if (giver.LastName.Equals(receiver.LastName)) return false;

            return true;
        }
示例#11
0
        public void LastName_CombinedFirstAndLastNames()
        {
            Person person = new Person(FULL_NAME, EMAIL);

            Assert.AreEqual(LASTNAME, person.LastName);
        }
示例#12
0
        public void FullName_SeparateFirstAndLastNames()
        {
            Person person = new Person(FIRSTNAME, LASTNAME, EMAIL);

            Assert.AreEqual(FULL_NAME, person.FullName);
        }
示例#13
0
        public void Email_SeparateFirstAndLastNames()
        {
            Person person = new Person(FIRSTNAME, LASTNAME, EMAIL);

            Assert.AreEqual(EMAIL, person.Email);
        }
示例#14
0
        public void Email_CombinedFirstAndLastNames()
        {
            Person person = new Person(FULL_NAME, EMAIL);

            Assert.AreEqual(EMAIL, person.Email);
        }
 public SecretSantaPair(Person giver, Person receiver)
 {
     Giver = giver;
     Receiver = receiver;
 }