public async Task GetServerReturnsServer() { Server server = new Server("1.2.3.4", 5678); SavedServerSource serverSource = new SavedServerSource(server); Assert.AreSame(server, await serverSource.GetServer(logger, clock, source)); }
private async Task SaveServer(Server server, string name) { for (int index = SAVED_SERVER_INDEX; index < SelectionCombo.Items.Count; index++) { ServerSelectionItem item = (ServerSelectionItem)SelectionCombo.Items[index]; SavedServerSource source = (SavedServerSource)item.GetSource(); if (server.Equals(await source.GetServer())) { source.ServerName = name; return; } } AddServer(server, name); }
public async Task GetServerReturnsNullIfConstructedWithoutParameters() { SavedServerSource serverSource = new SavedServerSource(); Assert.IsNull(await serverSource.GetServer()); }