public void UpdateMailRelayUpdatesContact()
        {
            Contact contact = InsertContact();

            DatabaseUpdateMailrelayFromContact databaseUpdateMailrelayFromContact = CreateDatabaseUpdateMailrelayFromContact(contact);

            UpdateMailrelayFromContact UpdateMailrelayFromContact = new UpdateMailrelayFromContact(Connection, databaseUpdateMailrelayFromContact);

            UpdateMailrelayFromContact.ChangeMailrelayConnection(_mailrelayConnectionTester);

            EnqueueGetSubscriberUpdateSubscriberReply();

            UpdateMailrelayFromContact.ExecuteOption(new Administration.Option.Options.OptionReport(typeof(UpdateMailrelayFromContactTest)));

            Contact contactRead = Contact.ReadFromFetchXml(DynamicsCrmConnection, new List <string>()
            {
                "new_mailrelaysubscriberid", "new_mailrelaycheck"
            }, new Dictionary <string, string>()
            {
                { "contactid", contact.Id.ToString() }
            }).Single();

            Assert.AreEqual(contact.new_mailrelaysubscriberid, contactRead.new_mailrelaysubscriberid);
            Assert.IsFalse(string.IsNullOrWhiteSpace(contactRead.new_mailrelaycheck));

            contact.Delete();
        }
        public void UpdateMailRelayUpdatesIfNeeded()
        {
            Contact contact = InsertContact();

            DatabaseUpdateMailrelayFromContact databaseUpdateMailrelayFromContact = CreateDatabaseUpdateMailrelayFromContact(contact);

            UpdateMailrelayFromContact UpdateMailrelayFromContact = new UpdateMailrelayFromContact(Connection, databaseUpdateMailrelayFromContact);

            UpdateMailrelayFromContact.ChangeMailrelayConnection(_mailrelayConnectionTester);

            EnqueueGetSubscriberUpdateSubscriberReply();

            UpdateMailrelayFromContact.ExecuteOption(new Administration.Option.Options.OptionReport(typeof(UpdateMailrelayFromContactTest)));

            Console.Out.WriteLine(_mailrelayConnectionTester);

            contact.Delete();
        }
 public UpdateMailrelayFromContact(MongoConnection connection, DataLayer.MongoData.Option.OptionBase databaseOption) : base(connection, databaseOption)
 {
     _databaseUpdateMailrelayFromContact = (DatabaseUpdateMailrelayFromContact)databaseOption;
 }