private SyncFailureCell cellConfiguration(UITableViewCell cell, SyncFailureItem model) { var syncFailureCell = (SyncFailureCell)cell; syncFailureCell.Update(model); return(syncFailureCell); }
public void SetsClientTypeIfConstructedWithAClient() { var client = Substitute.For <IThreadSafeClient>(); client.Name.Returns("My Client"); SyncFailureItem syncFailure = new SyncFailureItem(client); syncFailure.Type.Should().Be(ItemType.Client); }
public void SetsTagTypeIfConstructedWithATag() { var tag = Substitute.For <IThreadSafeTag>(); tag.Name.Returns("My Tag"); SyncFailureItem syncFailure = new SyncFailureItem(tag); syncFailure.Type.Should().Be(ItemType.Tag); }
public void SetsProjectTypeIfConstructedWithAProject() { var project = Substitute.For <IThreadSafeProject>(); project.Name.Returns("My Project"); SyncFailureItem syncFailure = new SyncFailureItem(project); syncFailure.Type.Should().Be(ItemType.Project); }
public void SetsTheCorrectProperties() { var tag = Substitute.For <IThreadSafeClient>(); tag.Name.Returns("My Client"); tag.SyncStatus.Returns(SyncStatus.SyncFailed); tag.LastSyncErrorMessage.Returns("Something bad happened"); SyncFailureItem syncFailure = new SyncFailureItem(tag); syncFailure.Name.Should().Be("My Client"); syncFailure.SyncStatus.Should().Be(SyncStatus.SyncFailed); syncFailure.SyncErrorMessage.Should().Be("Something bad happened"); }
public void Update(SyncFailureItem model) { typeLabel.Text = $"{model.Type}: "; nameLabel.Text = model.Name; syncStatusLabel.Text = model.SyncStatus.ToString(); errorMessageLabel.Text = model.SyncErrorMessage; switch (model.SyncStatus) { case SyncFailed: syncStatusLabel.TextColor = UIColor.Red; break; case SyncNeeded: syncStatusLabel.TextColor = UIColor.DarkGray; break; default: break; } }