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 )); }
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 ) )); }