public void TestDeleteContactThrowsException()
        {
            Mock<DbSet<Contact>> mockSet = _createContactDbSet();

            // Set up the mock repository
            Mock<IContactRepository> mockRepository = new Mock<IContactRepository>();
            mockRepository.Setup(x => x.DeleteContact(It.IsAny<int>())).Throws(new Exception()); // DeleteContact will raise an exception.
            mockRepository.Setup(x => x.GetContacts()).Returns(mockSet.Object);

            // Instantiate the biz logic class we plan to test a component of, pass in the mocked repository
            ContactUtilities contactUtilities = new ContactUtilities(mockRepository.Object);

            // Run the code we want to test, keep the results
            bool contactDeleted = contactUtilities.DeleteContact(1);

            Assert.IsFalse(contactDeleted);
        }
        public void TestDeleteContactWhoIsNotAManager()
        {
            Mock<DbSet<Contact>> mockSet = _createContactDbSet();

            // Set up the mock repository
            Mock<IContactRepository> mockRepository = new Mock<IContactRepository>();
            mockRepository.Setup(x => x.DeleteContact(It.Is<int>(y => y == 3)));
            mockRepository.Setup(x => x.GetContacts()).Returns(mockSet.Object);

            // Instantiate the biz logic class we plan to test a component of, pass in the mocked repository
            ContactUtilities contactUtilities = new ContactUtilities(mockRepository.Object);

            // Run the code we want to test, keep the results
            bool contactDeleted = contactUtilities.DeleteContact(3);

            Assert.IsTrue(contactDeleted);
        }