public async Task ChangeStatus(bool isRunning) { var name = await _twitter.GetName(); if (isRunning && name.EndsWith(_underMaintenanceSuffix)) { name = name.Replace(_underMaintenanceSuffix, ""); } if (!isRunning && !name.EndsWith(_underMaintenanceSuffix)) { name += _underMaintenanceSuffix; } await _twitter.SetName(name); }
public static InfoPrinter GetInfoPrinter(ITwitter twitter) => new InfoPrinter(twitter.GetName(), twitter.GetAge(), twitter.GetFriendsCount());