Exemple #1
0
        public static HostState Map(
            this ISMTPImpostorHost source)
        {
            if (source == null)
            {
                return(null);
            }

            return(new HostState(
                       source.Settings.Id,
                       source.Settings.Name,
                       source.Settings.IP, source.Settings.Port,
                       source.Settings.StoreType,
                       source.State,
                       source.Messages.Count,
                       source.Settings.Store.MaxMessages
                       ));
        }
Exemple #2
0
        public static SMTPImpostorHostSettings MapToSettings(
            this ISMTPImpostorHost source,
            HostUpdate update)
        {
            if (source == null)
            {
                return(null);
            }

            return(new SMTPImpostorHostSettings(
                       source.Settings.Id,
                       update.IP ?? source.Settings.IP, update.Port ?? source.Settings.Port,
                       update.Name ?? source.Settings.Name,
                       source.Settings.StoreType,
                       source.State == SMTPImpostorHostStatus.Started,
                       new SMTPImpostorMessagesStoreSettings(
                           update.MaxMessages ?? source.Settings.Store.MaxMessages
                           )
                       ));
        }